help-make
[Top][All Lists]
Advanced

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

Re: Intermediate files are not being rebuilt


From: Simon De Groot
Subject: Re: Intermediate files are not being rebuilt
Date: Thu, 27 Jan 2005 16:36:16 +0100


Hi Paul,

Thanks for your answer. The foo-target approach indeed renders the target non-intermediate and causes it to be rebuilt. Do you also have a solution to do this for pattern rules like sub%, or would I have to define:

foo : sub1 sub2 ... subblabla ... subi'mgettingtirednow

Regards,

Simon de Groot
CAD Engineer
National Semiconductor B.V.
Het Zuiderkruis 53
NL-5215 MV 's-Hertogenbosch
The Netherlands
Tel. +31(0)73-6408332, Fax +31(0)73-6408823
mailto:address@hidden
http://www.national.com

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is prohibited. If you are not the intended or authorized recipient please contact the sender by reply email and delete all copies of this message.



"Paul D. Smith" <address@hidden>
Sent by: "Paul Smith" <address@hidden>

01/27/2005 03:55 PM

Please respond to
"Paul D. Smith" <address@hidden>

To
"Simon De Groot" <address@hidden>
cc
address@hidden
Subject
Re: Intermediate files are not being rebuilt





%% "Simon De Groot" <address@hidden> writes:

 sdg> Now, if I delete sub1, it will not be rebuilt the next time I run make:

 csh> rm sub1
 csh> make
 sdg> make: Nothing to be done for `all'.

 sdg> Without the .SECONDARY target, sub1 and sub2 are deleted
 sdg> altogether after each run.

 sdg> I'm not used to this behavior when I was using Solaris' make. Is
 sdg> there a way to enforce that prerequisites are forced to be
 sdg> rebuilt?

Read up on intermediate files in the GNU make manual.  Since you never
reference those files directly, make considers them to be intermediate
files which are not themselves required, but only used as a stepping
stone to a different target.  So, if A -> B -> C, and if B is not
required as a final target, and if A is older than C, then make won't
create B even if it doesn't exist, since C doesn't need to be updated.
If make DID create B, then it would have to recreate C (since B is
newer) and since A has not been changed (and B is not required) there's
no reason to do that.


Anyway, any explicit reference to the file in the makefile causes a
target to be considered not precious.

So, you can just add in:

   all: sub1 sub2

or even "foo: sub1 sub2".

--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden>          Find some GNU make tips at:
http://www.gnu.org                      http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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