ALL: a.out %.o: %.mod # PETSC_DIR and PETSC_ARCH should be set either in env or in this makeifle PETSC_DIR=/home/wtay/Lib/petsc-3.1-p5 #PETSC_ARCH=atlas4_hypre2.6b_nodebug CFLAGS = FFLAGS = -g -r8 -save -w90 -w -w95 # instead of opt2 add these flags to default petsc compile target for .F/.f CPPFLAGS = FPPFLAGS = CLEANFILES = a.out include ${PETSC_DIR}/conf/variables include ${PETSC_DIR}/conf/rules opt = -g -r8 -w95 -c -save opt3 = -g -w95 -c -save libs =/home/wtay/Lib/tecio64.a OBJS = global.o grid.o flux_area.o airfoil.o bc.o bc_impl.o bc_semi.o set_matrix.o inter_step.o mom_disz.o hypre.o poisson.o cell_data.o fractional.o ns2d_c.o a.out : $(OBJS) $(FLINKER) -o a.out $(OBJS) $(libs) $(PETSC_LIB) #compiled these sources with default petsc targets global.o : global.F90 flux_area.o : flux_area.F90 global.o mom_disz.o : mom_disz.F90 inter_step.o set_matrix.o poisson.o : poisson.F90 mom_disz.o hypre.o : hypre.F90 mom_disz.o poisson.o cell_data.o : cell_data.F90 grid.o poisson.o ns2d_c.o : ns2d_c.F90 cell_data.o fractional.o # sources compiled separately - as they need different opt/opt3 compiler flags. airfoil.o : airfoil.f90 flux_area.o $(FC) $(opt) airfoil.f90 grid.o : grid.f90 airfoil.o $(FC) $(opt3) grid.f90 bc.o : bc.f90 flux_area.o $(FC) $(opt) bc.f90 bc_impl.o : bc_impl.f90 bc.o $(FC) $(opt) bc_impl.f90 bc_semi.o : bc_semi.f90 bc.o $(FC) $(opt) bc_semi.f90 set_matrix.o : set_matrix.f90 bc_semi.o bc_impl.o $(FC) $(opt) set_matrix.f90 inter_step.o : inter_step.f90 bc_impl.o $(FC) $(opt) inter_step.f90 fractional.o : fractional.f90 poisson.o $(FC) $(opt) fractional.f90