# Makefile template for t90

FC = f90
LD = f90
CPPFLAGS = -F
FFLAGS = -O2
LDFLAGS = -Wl"-Dpreset=nan $(LIBS)"
LIST = -O negmsgs -rs

# you should never need to change any lines below.

# see the CF90 manual for more details on some of the file extensions
# discussed here.
# this makefile template recognizes fortran sourcefiles with extensions
# .f, .f90, .F, .F90. Given a sourcefile <file>.<ext>, where <ext> is one of
# the above, this provides a number of default actions:

# make <file>.T		create a CIF file
# make <file>.lst	create a compiler listing
# make <file>.o		create an object file
# make <file>.s		create an assembly listing
# make <file>.x		create an executable file, assuming standalone
#			source

# make <file>.i		create a preprocessed file (only for .F and .F90
#			extensions)

# make <file>.hpm	produce hpm output from <file>.x
# make <file>.proc	produce procstat output from <file>.x

# The macro TMPFILES is provided to slate files like the above for removal.

RM = rm -f
SHELL = /bin/csh
TMPFILES = .*.m *.T *.TT *.hpm *.i *.lst *.proc *.s

.SUFFIXES: .F .F90 .H .T .f .F90 .h .hpm .i .lst .proc .o .s .x

.f.T:
	$(FC) $(FFLAGS) -c -Ca $*.f
.f.lst:
	$(FC) $(FFLAGS) $(LIST) -c $*.f
.f.o:
	$(FC) $(FFLAGS) -c     $*.f
.f.s:
	$(FC) $(FFLAGS) -eS    $*.f
.f.x:
	$(FC) $(FFLAGS) $(LDFLAGS) -o $*.x $*.f
.f90.T:
	$(FC) $(FFLAGS) -c -Ca $*.f90
.f90.lst:
	$(FC) $(FFLAGS) $(LIST) -c $*.f90
.f90.o:
	$(FC) $(FFLAGS) -c     $*.f90
.f90.s:
	$(FC) $(FFLAGS) -c -eS $*.f90
.f90.x:
	$(FC) $(FFLAGS) $(LDFLAGS) -o $*.x $*.f90
.F.T:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c -Ca $*.F
.F.i:
	$(FC) $(CPPDEFS) $(CPPFLAGS) -eP $*.F
.F.lst:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) $(LIST) -c $*.F
.F.o:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c     $*.F
.F.s:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c -eS $*.F
.F.x:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) -o $*.x $*.F
.F90.T:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c -Ca $*.F90
.F90.i:
	$(FC) $(CPPDEFS) $(CPPFLAGS) -eP $*.F90
.F90.lst:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) $(LIST) -c $*.F90
.F90.o:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c     $*.F90
.F90.s:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) -c -eS $*.F90
.F90.x:
	$(FC) $(CPPDEFS) $(CPPFLAGS) $(FFLAGS) $(LDFLAGS) -o $*.x $*.F90
.x.proc:
	procstat -R $*.proc $*.x
.x.hpm:
	hpm -r -o $*.hpm $*.x
