help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to tell Make to depend on unknown files


From: Noel David Torres Taño
Subject: How to tell Make to depend on unknown files
Date: Wed, 28 Apr 2010 21:59:37 +0200
User-agent: KMail/1.9.9

Hello all:

I have this Makefile called Makefile.Makedep to extract dependency information 
from source files and create a Makefile.dep file that is included in the main 
Makefile:

Makefile.dep : *.F95 src/*.F95
        @echo "Reconstruyendo dependencias..."
        for i in *.F95 src/*.F95 ; do $(MAKE) -f Makefile.Makedep `dirname 
$$i`/`basename $$i .F95`.f95 ; done
        for j in *.f95 src/*.f95 ; do for i in `cat $$j|grep " use "|awk 
'{print $$2}'`; do echo `dirname $$j`/`basename $$j .f95`.o : modules/$$i.mod ; 
done ; done > $@
        @echo "Dependencias hechas."

%.f95 : %.F95
        @echo "***** Makedep: Regla: %.f95 : %.F95"
        $(FC) $(FFLAGS) -o $@ -E $<

src/%.f95 : src/%.F95
        @echo "***** Makedep: Regla: src/%.f95 : src/%.F95"
        $(FC) $(FFLAGS) -o $@ -E $<

The main Makefile also instructs how to remade it:

include Makefile.dep

Makefile.dep :
        $(MAKE) -f Makefile.Makedep

The problem is that if I move a .F95 file from the main subdirectory to the src 
one the dependencies need to change, but since moving does not alter the file's 
time, Makedile.dep seems to be up to date.

Any clue?

Thanks

Noel
er Envite

P.S. I'm using the .f95 instead of the .F95 to handle the preprocessor #include 
lines

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]