bug-make
[Top][All Lists]
Advanced

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

Re: Too speedy problem


From: Paul D. Smith
Subject: Re: Too speedy problem
Date: Tue, 24 Sep 2002 11:13:07 -0400

Yes, this is a known issue with make and with any other tool that
operates based on comparing timestamps.  The debug messages I guess are
a little misleading in this case... when it says "prerequisite is newer"
what it really means is that the prerequisite was changed during this
invocation of make.  It still might not be newer than the target.

Make will only rebuild a target if at least one of its dependencies has
a mod time _greater_ than its own.  It doesn't matter whether the
dependencies were rebuilt (it's not uncommon to have makefiles where
rules fire, but don't actually update the target unless something
changed), it only matters what their mod time is.

So, the best granularity you can achieve in terms of accurate rebuilding
is the granularity of the timestamps on the filesystem.  Linux
filesystems only support 1 second granularity, so if your build can
complete and run again within 1 second make won't work correctly.

One answer to this is better granularity in filesystems: Solaris, for
example, as well as some others, support sub-second timestamp
granularity on their filesystems--if these are supported GNU make will
detect it and use them (of course, sometimes you now have the opposite
problem especially in a networked environment).


The best answer is to fundamentally change make from a stateless tool to
a stateful tool.  If make preserved some state between invocations then
it would not have to rely on relative comparisons of timestamps: it
could, for example, store the exact timestamp (and maybe other things)
and rebuild if any of those changed.  This would allow for much more
accurate rebuild.

But, that is not a small project.

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