This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
--- FX Coudert <fxcoudert@gmail.com> wrote:
This is a change from 4.2, IIRC, and it was done because users complained that .mod files had their timestamps updated while not changing, which triggered massive useless recompilations because of Makefile dependencies ;-)
Fair enough, I think that's OK
So, is there a solution for this?
Yes, I believe there is; the following Makefile seems to work fine:
all: a.o b.o
a.o: a.f90 b.mod gfortran -c $<
b.o: b.f90 gfortran -c $<
b.mod: b.f90 b.o @true
a.mod: a.f90 a.o @true
It works... until one deletes the .mod files (which can happen by
accident), then make doesn't know how to build them. I guess I could
use something like "test -e $@ || gfortran -c $<" instead of "@true"...
Anyway, there is another (minor) problem: with that solution make still
thinks there is something to build and does not inform that everything
is up to date, even though it doesn't actually build anything.
a.o: a.f90 b.o gfortran -c $<
b.o: f.90 gfortran -c $<
%.o: %.f90 gfortran -c $*.f90
a.o a.mod: a.f90 gfortran -c $<
-- Erik Schnetter <schnetter@cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net.
Attachment:
PGP.sig
Description: This is a digitally signed message part
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |