# Makefile for gtool4/libsrc/netcdf

OBJS=netcdf.obj netcdf_v3.obj netcdf_error.obj netcdf_filename.obj \
        netcdf_file.obj netcdf_dimension.obj netcdf_variable.obj \
        netcdf_attribute.obj netcdf_slice.obj netcdf_io.obj
HTMS=netcdf.htm netcdf_file.htm netcdf_error.htm netcdf_variable.htm

STRDIR=..\string
MODDIR=..\..\lib
LIBDIR=..\..\lib
NCLIBDIR=$(DLIB)\STD

LIBPATH=$(LIBDIR)\gtool4.lib

.SUFFIXES: .f90 .obj .exe .3f .1 .htm .mod

all: lib doc

lib: $(OBJS)

doc: $(HTMS)

.f90.obj:
        df/c /mod:$(MODDIR) $<

.f90.exe:
	df /mod:$(MODDIR) $< *.obj ..\string\*.obj $(NCLIBDIR)\netcdf.lib

touch:
        touch *.3f

clean:
        -rm -f *.obj *.mod *.bak test.nc *.exe
	
clean.all: clean
	-rm -f *.htm

.3f.htm:
	htroff -man -u -a $<

CHARS=$(MODDIR)\dc_chars.mod
STRING=$(MODDIR)\iso_varying_string.mod

netcdf_error.obj: netcdf_v3.obj $(STRING)
netcdf_filename.obj: $(STRING)
netcdf_file.obj: netcdf_filename.obj netcdf_error.obj
netcdf_dimension.obj: netcdf_file.obj
netcdf_variable.obj: netcdf_dimension.obj
netcdf_slice.obj: netcdf_variable.obj
netcdf_io.obj: netcdf_slice.obj $(CHARS)
netcdf_attribute.obj: netcdf_variable.obj
netcdf.obj: netcdf_io.obj netcdf_attribute.obj

netcdf_error.htm: netcdf_v3.htm
netcdf_file.htm: netcdf_error.htm
netcdf_dimension.htm: netcdf_file.htm
netcdf_variable.htm: netcdf_dimension.htm
netcdf_slice.htm: netcdf_variable.htm
netcdf_attribute.htm: netcdf_variable.htm
netcdf.htm: netcdf_slice.htm netcdf_attribute.htm

