#
# Location of HDF5 binaries (with include/ and lib/ underneath)
HDF5 = /mnt/hdf/packages/hdf5/v189/Linux_2.6/hdf5-1.8.9-linux-static

# Location of External Libraries
LIBZ    = /mnt/hdf/packages/hdf5/v189/Linux_2.6/hdf5-1.8.9-linux-static/lib/libz.a
LIBSZ   = /mnt/hdf/packages/hdf5/v189/Linux_2.6/hdf5-1.8.9-linux-static/lib/libsz.a

# Compiler
FC        = gfortran

# ------ No machine-specific paths/variables after this  -----

FORTRANLIB=-I$(HDF5)/include $(HDF5)/lib/libhdf5_fortran.a

FSOURCE = dsetexample fileexample
OBJECTS = dsetexample.o fileexample.o

FLAGS   = -c  
LIBSHDF   = $(FORTRANLIB) $(HDF5)/lib/libhdf5.a 
LIB       = $(LIBZ) $(LIBSZ) -lm

all:    $(FSOURCE)

dsetexample: dsetexample.f90 
	$(FC) -o $@ dsetexample.f90 $(LIBSHDF) $(LIB)

fileexample: fileexample.f90 
	$(FC) -o $@ fileexample.f90 $(LIBSHDF) $(LIB)

clean:
	rm -f $(FSOURCE) $(OBJECTS) *.h5

.f90.o: $(FSOURCE)
	$(FC) $(FLAGS) $?
.SUFFIXES:.o.c.f90
