# Requirements: GNU make, GNU C, and an F90 compiler # Platforms: IBM, SGI, Cray, DEC, Sun (both SunSoft and CraySoft F90) # To build executable: # # gmake trac_bench # # If on Solaris using CraySoft F90: # # gmake cray=y trac_bench # Figure out what operating system is being used. uname = $(shell uname -a) os = $(firstword $(uname)) ifeq (sn,$(findstring sn,$(os))) os = UNICOS CPPFLAGS = -Dunicos endif ifeq (IRIX, $(findstring IRIX,$(os))) os = IRIX endif # Define cray macro for cpp if appropriate. ifdef cray CPPFLAGS += -Dcray endif # Command name and flags for F90. ifeq ($(os),AIX) FC = f90 FFLAGS = -O3 -qextname endif ifeq ($(os),IRIX) FC = f90 FFLAGS = -O3 endif ifeq ($(os),OSF1) FC = f90 FFLAGS = -fast -O5 -tune host endif ifeq ($(os),SunOS) ifdef cray FC = f90 FFLAGS = -a dalign -O scalar3 else FC = f90 FFLAGS = -fast endif endif ifeq ($(os),UNICOS) FC = f90 FFLAGS = -O vector3 endif # How to preprocess. %.f90: %.F90 cp $< $(basename $<).c gcc -traditional -E $(CPPFLAGS) $(basename $<).c | grep -v "^$$" | grep -v "^#" > $@ rm -f $(basename $<).c # How to build executable. trac_bench: trac_bench.f90 $(FC) -o $@ $(FFLAGS) $< dist: tar cvf trac_bench.tar trac_bench.F90 GNUmakefile # Cleanup. clean: rm -f *~ *.f90 *.M *.mod trac_bench