VPATH = .:TMP .SUFFIXES: .SUFFIXES: .o .F90 .f90 .F .f .H .h .c 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) # This puts on the "scalar transport" feature CPPFLAGS:=$(CPPFLAGS) -DSCALAR_TRANS # 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 .H.h: rm -f ./TMP/$*.h cat $*.H > ./TMP/$*.h .F90.o: cd ./TMP ; $(CF90) -c $(CPPFLAGS) $(FFLAGS) $(F90FLG) $(INCLUDE) -o $*.o ../$< .F.o: cd ./TMP ; $(CF77) -c $(CPPFLAGS) $(FFLAGS) $(F77FLG) $(INCLUDE) -o $*.o ../$< .c.o: cd ./TMP ; $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $*.o ../$*.c ######################################################################## # TARGET2 : Finds section intersections, and dumps these to a datafile # which can be read by other programs. # # TARGET3 : Extracts data from sections (using output from target2 program # # TARGET4 : Calculate transport using data generated by target2 program. # Transport is calculated over full water column. # # TARGET5 : Calculate transport using data generated by target2 program. # Transport is calculated over ranges (ex temp, saln, depth) # ######################################################################## TARGET2 = section_intersect TARGET3 = section_plot TARGET4 = section_transport TARGET5 = section_transport2 targets = $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) scripts = m2section m2transport m2transport2 INC2 =$(INC1:.H=.h) OMOD = $(MODULES:.F90=.o) $(MODULES77:.F=.o) all: $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) ############################################################################# OBJECTS2= \ m_handle_err.o \ mod_sphere_tools.o \ mod_sections.o \ p_section_intersect.o $(TARGET2): $(INC2) $(OBJECTS2) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET2) $(OBJECTS2) $(LIBS) ############################################################################## OBJECTS3= \ m_handle_err.o \ mod_sphere_tools.o \ mod_sections.o \ p_section_plot.o $(TARGET3): $(INC2) $(OBJECTS3) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET3) $(OBJECTS3) $(LIBS) ############################################################################## OBJECTS4= \ m_depth_frac.o \ m_handle_err.o \ mod_sphere_tools.o \ mod_sections.o \ mod_transport.o \ p_transport.o $(TARGET4): $(INC2) $(OBJECTS4) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET4) $(OBJECTS4) $(LIBS) ############################################################################## OBJECTS5= \ m_depth_frac.o \ m_handle_err.o \ mod_sphere_tools.o \ mod_sections.o \ mod_transport.o \ p_transport2.o $(TARGET5): $(INC2) $(OBJECTS5) cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET5) $(OBJECTS5) $(LIBS) ############################################################################## install : all mkdir -p ../../bin/ cp $(targets) ../../bin/ cp $(scripts) ../../bin/ clean: rm ./TMP/*.f TMP/*.o TMP/*.f90 TMP/*.h TMP/*.mod $(targets)