#
# Makefile
#

include ../Makefile.in

###############################################################################
#
# ZioLib tests
#
###############################################################################

ZIOMODS = zio_data.o zio_remap.o zio_netcdf77.o zio_binary.o zio.o
ZIOOBJS = $(foreach zioobj,$(ZIOMODS),../$(zioobj))

tests: bintest1 bintest2 bintest3 bintest4 nftest1 nftest2 nftest3 nftest4

bintest1.o: $(ZIOOBJS)
bintest1: bintest1.o
	$(LD) -o $@ bintest1.o $(ZIOOBJS) $(LDFLAGS)

bintest2.o: $(ZIOOBJS)
bintest2: bintest2.o
	$(LD) -o $@ bintest2.o $(ZIOOBJS) $(LDFLAGS)

bintest3.o: $(ZIOOBJS)
bintest3: bintest3.o
	$(LD) -o $@ bintest3.o $(ZIOOBJS) $(LDFLAGS)

bintest4.o: $(ZIOOBJS)
bintest4: bintest4.o
	$(LD) -o $@ bintest4.o $(ZIOOBJS) $(LDFLAGS)

nftest1.o: $(ZIOOBJS)
nftest1: nftest1.o
	$(LD) -o $@ nftest1.o $(ZIOOBJS) $(LDFLAGS)

nftest2.o: $(ZIOOBJS)
nftest2: nftest2.o
	$(LD) -o $@ nftest2.o $(ZIOOBJS) $(LDFLAGS)

nftest3.o: $(ZIOOBJS)
nftest3: nftest3.o
	$(LD) -o $@ nftest3.o $(ZIOOBJS) $(LDFLAGS)

nftest4.o: $(ZIOOBJS)
nftest4: nftest4.o
	$(LD) -o $@ nftest4.o $(ZIOOBJS) $(LDFLAGS)

#-------------------------------------------------------------------------------
#   Suffix rules
#-------------------------------------------------------------------------------

.SUFFIXES:
.SUFFIXES: .F .F90 .f90 .f .o
.F.o:
	$(FC) -c $(FIXEDFLAGS) $(FFLAGS) $<
.F90.o:
	$(FC) -c $(FREEFLAGS) $(FFLAGS) $<
.f.o:
	$(FC) -c $(FIXEDFLAGS) $(FFLAGS) $<
.f90.o:
	$(FC) -c $(FREEFLAGS) $(FFLAGS) $<

clean:
	$(RM) -f *.o bintest[1-4] nftest[1-4] snapshot*
