help-make
[Top][All Lists]
Advanced

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

Re: question about Generating Prerequisites Automatically


From: Paul D. Smith
Subject: Re: question about Generating Prerequisites Automatically
Date: Thu, 11 May 2006 07:13:54 -0400

%% Lin George <address@hidden> writes:

  >> So, make uses one set of rules to determine when to rebuild normal
  >> targets (that are not "intermediate"), and it uses a different set
  >> of rules to determine when to rebuild targets that ARE
  >> "intermediate".

  lg> That is exactly what I mean. :-)

  lg> Could you quote the rule which make will use to evaluate whether
  lg> an intermediate file is "needed" please? I understand your sample,
  lg> but it still seems mysterious to me about a general rule about how
  lg> make will evaluate whether or not it is "needed". :-)

It's very, very simple; I've already quoted the relevant section of the
manual earlier in this thread.  From "Chains of Implicit Rules" in the
GNU make manual:

>    The first difference is what happens if the intermediate file does
> not exist.  If an ordinary file B does not exist, and `make' considers
> a target that depends on B, it invariably creates B and then updates
> the target from B.  But if B is an intermediate file, then `make' can
> leave well enough alone.  It won't bother updating B, or the ultimate
> target, unless some prerequisite of B is newer than that target or
> there is some other reason to update that target.

An ordinary target is updated if EITHER its prerequisites are newer, OR
the target doesn't exist.

An intermediate target is updated ONLY if its prerequisites are newer.

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