# 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

STRDIR=..\string
MODDIR=..\..\lib
LIBDIR=..\..\lib
NCLIBDIR=$(DLIB)\STD
DCL90DIR=$(DLIB)
DCL90LIB=$(DCL90DIR)\STD\dcl_f90.lib $(DLIB)\STD\dcl.lib
DCL90MOD=$(DCL90DIR)\module

LIBPATH=$(LIBDIR)\gtool4.lib

.SUFFIXES: .f90 .obj .exe .3f .htm .mod

all: lib 

lib: $(OBJS)

.f90.obj:
        df/c /include:$(DCL90MOD) /mod:$(MODDIR) $<

.f90.exe:
	df /include:$(DCL90MOD) /mod:$(MODDIR) $< *.obj ..\string\*.obj $(NCLIBDIR)\netcdf.lib $(DCL90LIB)

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

