Problems with a makefile and mixed Fortran and Fortran 90 code -
i trying update old fortran code , want use makefile build it. right now, makefile looks like
fc = gfortran fflags = -o2 hdrs = global.h param.h coor.h srcs = xxx.f yyy.f zzz.f newstuff.f90 main.f objs = $(srcs:.f=.o) objs := $(objs:.f90=.o) runit: $(objs) $(fc) $(fflags) -o $@ $^ xxx.o yyy.o main.o : global.h yyy.o zzz.o: coor.h xxx.o yyy.o zzz.o main.o : param.h xxx.o main.o : newstuff.o clean: rm runit *.o *.mod .suffixes: .f .f90 .o .f.o: $(fc) $(fflags) -c $< .f90.o: $(fc) $(fflags) -c $<
i have 2 questions. first, edit newstuff.f90 , issue make newstuff.o
, expecting new newstuff.o
. instead, message newstuff.o date. doesn't happen of other source codes. have convince make newstuff.o indeed out of date?
second, trying hack fix, inserted line (not shown above): newstuff.o : newstuff.f90
. line in makefile, make returns
m2c -o mpi_wrapper.o mpi_wrapper.mod make: m2c: no such file or directory
why make go other utility m2c, whatever is? how convince use gfortran? thanks.
Comments
Post a Comment