makefile.old 1.72 KB
VPATH = .:TMP

.SUFFIXES:
.SUFFIXES: .o .F90 .f90 .F .f .H .h  


LD = f90
CF90 = f90
CF77 = f90


FFLAGS =  -64  -mips4 -r8 -r10000
FFLAGS =  -64  -mips4 -r8 -r10000 -avoid_gp_overflow

F77FLG =  -O2 
F77FLG =  -pfa -O2 -mp -OPT:IEEE_arithmetic=3:roundoff=3:Olimit=0
F77FLG =  -g  -TENV:check_div=3 -TENV:trapuv=ON -C
F77FLG =  -O2 -OPT:roundoff=0 -mp

F90FLG =  -O2
F90FLG =  -pfa -O2 -mp -OPT:IEEE_arithmetic=3:roundoff=3:Olimit=0
F90FLG =  -g  -TENV:check_div=3 -TENV:trapuv=ON -C
F90FLG =  -O2 -OPT:roundoff=0 -mp

LINKFLAGS =  -64 -mips4 -r10000 -pfa -mp -OPT:Olimit=0
LINKFLAGS =  -64 -mips4 -r10000 
LINKFLAGS =  -64 -mips4 -r10000 -mp

TARGET =  eco

CPPARCH = -DSGI 
CPPMODEL  =  

CPPFLAGS = -P $(CPPARCH) $(CPPMODEL)

LIBS =  -lcomplib.sgimath


CPP = /usr/lib/cpp


# Rules for running cpp and updating files in TMP directory
.H.h:
	rm -f ./TMP/$*.h
	cat MODEL.CPP $*.H | $(CPP) $(CPPFLAGS) > ./TMP/$*.h


.F90.o:
	rm -f ./TMP/$*.f90
	cat MODEL.CPP $*.F90 | $(CPP) $(CPPFLAGS) > ./TMP/$*.f90
	cd ./TMP ; $(CF90) -c -freeform $(FFLAGS) $(F90FLG) -o $*.o $*.f90  

.F.o:
	rm -f ./TMP/$*.f
	cat MODEL.CPP $*.F | $(CPP) $(CPPFLAGS) > ./TMP/$*.f
	cd ./TMP ; $(CF77) -c -col72 $(FFLAGS) $(F77FLG) -o $*.o $*.f  



include source.files

INC2 =$(INC1:.H=.h)
FILES =$(F90FILES) $(F77FILES) $(MODULES)
FFILES =$(F90FILES:.F90=.f90) $(F77FILES:.F=.f) $(MODULES:.F90=.f90)
OBJECTS = $(F90FILES:.F90=.o) $(F77FILES:.F=.o) 
OMOD = $(MODULES:.F90=.o)


all: $(TARGET) 


$(TARGET): $(INC2) $(OMOD) $(OBJECTS) 
	cd ./TMP ; $(LD) $(LINKFLAGS) -o ../$(TARGET) $(OMOD) $(OBJECTS) $(LIBS) 



clean:
	cd ./TMP ; rm *.f  *.o *.f90 *.h *.mod

new: source depend

source:
	mksource.sh > source.files

depend:
	mkdepend.sh | sort -u > depends.file

include depends.file