我正在尝试编写一个 Fortran 生成文件:只有一个“主”文件,但我已将模块放在单独的 .f90 文件中。附加的makefile有效,但是即使我不做任何更改,它也会强制重新编译。我正在使用 gfortan 4.7.2 和 GNU Make 3.81 运行 x86-64 Linux。
FC = gfortran
FCFLAGS += -ffree-line-length-none -finit-local-zero
#FCFLAGS += -fbounds-check -ffpe-trap=invalid
all: new
new: ALE.o curvilinear.o new.o
$(FC) $(FCFLAGS) -o new new.o ALE.o curvilinear.o
new.o: ALE.mod curvilinear.mod new.f90
$(FC) $(FCFLAGS) -c new.f90
ALE.o: ALE.f90
$(FC) $(FCFLAGS) -c ALE.f90
ALE.mod: ALE.o ALE.f90
curvilinear.o: ALE.o curvilinear.f90
$(FC) $(FCFLAGS) -c curvilinear.f90
curvilinear.mod: curvilinear.o curvilinear.f90
clean:
rm ale.mod curvilinear.mod ALE.o curvilinear.o new new.o
输出:
$ make clean
rm ale.mod curvilinear.mod ALE.o curvilinear.o new new.o
$ make
gfortran -ffree-line-length-none -finit-local-zero -c ALE.f90
gfortran -ffree-line-length-none -finit-local-zero -c curvilinear.f90
gfortran -ffree-line-length-none -finit-local-zero -c new.f90
gfortran -ffree-line-length-none -finit-local-zero -o new new.o ALE.o curvilinear.o
$ make
gfortran -ffree-line-length-none -finit-local-zero -c new.f90
gfortran -ffree-line-length-none -finit-local-zero -o new new.o ALE.o curvilinear.o
为什么在没有进行任何更改的情况下重新编译“新”?