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:[EMAIL PROTECTED]
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"
<[EMAIL PROTECTED]>
Sent by: "Paul Smith" <[EMAIL PROTECTED]> 01/27/2005 03:55 PM
|
|
%% "Simon De Groot" <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
_______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
