help-make
[Top][All Lists]
Advanced

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

Re: Make and Fortran modules


From: Alberto Luaces
Subject: Re: Make and Fortran modules
Date: Tue, 06 Apr 2010 16:08:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Noel David Torres Taño writes:

> 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?

I really don't understand what is the purpose of that code, because
every time the .F95 is updated, the .mod file is also touched, even when
its contents are the same -- when no recompilation of the objects
depending on that module is needed. Therefore you should get an
unnecessary recompilation of all the objects depending on that module.

IMHO, the real solution would be to address the relationship between a
.F95 file and the modules it depends on, avoiding the recompilation if
the interface has not been changed. This is what the paper addresses
through several methods.

Un saludo,

--
Alberto




reply via email to

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