help-make
[Top][All Lists]
Advanced

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

Re: why are all prerequisites timestamps checked, even after one is foun


From: Paul Smith
Subject: Re: why are all prerequisites timestamps checked, even after one is found to be newer than target??
Date: Mon, 14 Dec 2009 08:39:21 -0500

On Sun, 2009-12-13 at 23:45 -0800, Mark Galeck (CW) wrote:

> I just called make –d on a target with many prerequisites.  Make
> examined all the prerequisites – whether they needed to be rebuilt,
> and after that, started checking the timestamps.  The first
> prerequisite was found to be newer than target.  
> 
> Then why did it continue to check the timestamps of all the rest of
> the prerequisites??  Is this not a waste of time?  How to prevent that
> behavior?

Make will always update every target that is out of date.  Remember that
every prerequisite is also a target: make works in a recursive manner.
If you have a rule like this:

        foo: bar biz baz boz

and make sees that bar is newer than foo, that doesn't mean it can't
stop because the prerequisites biz, baz, and boz also need to be
considered as targets, to see if they need to be updated.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]