VPATH = .:RCS:TMP:../Nersclib/ .SUFFIXES: .SUFFIXES: .o .F .f include ../Make.Inc/make.inc # This is the hycom utility library # NB: Path is relative to TMP dir LIBS:= -L../../../lib/ -lhycnersc $(LIBS) # This is the hycom utility includes (modules) # NB: Path is relative to TMP dir INCLUDE:= -I../ -I../../../include/ $(INCLUDE) MODS = mod_xc.o mod_za.o wtime.o # AIX (xlf) peculiarities. NB: Only necessary for Fortran files ifneq (,$(findstring -DAIX,$(CPPFLAGS))) subs=-WF,- CPPFLAGS:=$(subst -,$(subs),$(CPPFLAGS)) endif # Rules for running cpp and updating files in TMP directory .F90.o: cd ./TMP ; $(CF90) -c $(CPPFLAGS) $(FFLAGS) $(F90FLG) $(INCLUDE) -o $*.o ../$< .F.o: cd ./TMP ; $(CF77) -c $(CPPFLAGS) $(FFLAGS) $(F77FLG) $(INCLUDE) -o $*.o ../$< .f.o: cd ./TMP ; $(CF77) -c $(FFLAGS) $(F77FLG) $(INCLUDE) -o $*.o ../$< TARGET1 = rmunew TARGET2 = relax_tracer TARGET3 = z_glodap_co2 TARGET4 = z_levitus_bio TARGET5 = z_woa2013_bio all: $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) ############################################################################### OBJECTS1= rmunew.o \ zh.o $(TARGET1): $(OBJECTS1) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET1) $(OBJECTS1) $(LIBS) ############################################################################### OBJECTS2= relax_tracer.o \ zh.o \ blkdat.o $(TARGET2): $(MODS) $(OBJECTS2) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET2) $(OBJECTS2) $(LIBS) ############################################################################### OBJECTS3= z_glodap_co2.o \ zh.o \ interp.o $(TARGET3): $(MODS) $(OBJECTS3) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET3) $(OBJECTS3) $(LIBS) ############################################################################### OBJECTS4= z_levitus_bio.o \ zh.o \ interp.o $(TARGET4): $(MODS) $(OBJECTS4) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET4) $(OBJECTS4) $(LIBS) ############################################################################### OBJECTS5= z_woa2013_bio.o \ zh.o \ interp.o $(TARGET5): $(MODS) $(OBJECTS5) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET5) $(OBJECTS5) $(LIBS) ############################################################################### clean: rm ./TMP/*.o TMP/*.mod $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) install : all mkdir -p ../../bin_setup/ cp $(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) ../../bin_setup/