On Tuesday 30 March 2010 15:27:26 Alberto Luaces wrote: > Noel David Torres Taño writes: > > > Hello all: > > > > Fortran modules are made by compiling source code, at the same time object > > files are. Thus, > > > > gfortran -o module.o -c module.F95 > > > > produces TWO files, module.o AND module.mod . > > > > But, the problem is that in a large project using modules, some objects > > depend on other modules: > > > > %.o : %.F95 > > > > %.mod : %.F95 > > > > codepiece2.o : codepiece1.mod > > > > exec1 : codepiece1.o codepiece2.o > > > > exec2 : codepiece3.o codepiece2.o > > > > How do you address these issues? > > You have to write the rules describing those dependencies by yourself or > with the aid of a script that reads the Fortran files and guesses the > modules each one is using. Yesterday I posted a link to some information > about the issue. > > -- > Alberto
Gracias, Alberto, but I'm not talking about writing the dependences, but
avoiding unnecesary work. My Makefile depends on source code files, 'cos the
dependences are auto-extracted, thus I want to avoid as much $(MAKE) calls as
possible.
What I'm doing just now to avoid those cascades is:
%.mod : %.F95
@echo $(MAKE) $*.o
@(export temp=`mktemp` ;\
touch -r $*.F95 $$temp ;\
touch $*.F95 ;\
$(MAKE) $*.o ;\
touch -r $$temp $*.F95 ;\
rm $$temp)
What do you think about that?
Un saludo
Noel
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
