[Top][All Lists]

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

Re: was: RE: auto-dep cannot possibly work?

From: Paul Smith
Subject: Re: was: RE: auto-dep cannot possibly work?
Date: Mon, 14 Dec 2009 10:17:03 -0500

On Fri, 2009-12-11 at 19:06 -0500, David Boyce wrote:
> I wish both you and Paul would 'come to understand' that I was right
> way back in the early part of the thread, that it is absolutely
> "feasible in principle to cover the case of new header files appearing
> ..." by using the directories themselves as prerequisites. By this I
> mean that it's an objectively correct solution.

I don't think anyone suggested that your proposal would not give the
"right" answer, if you define "right" as "at least everything that
needs to be rebuilt will be".  But in many situations it will not give
the "right" answer if you define "right" as "the least amount of work is
done. most of the time, to rebuild everything that needs to be

There are a range of possible solutions: at one end is the magical
holy grail where exactly what is needed to be rebuilt is rebuilt, no
more and no less, automatically by make without user intervention under
every situation.  That is what Mark was trying to find.  At the other
end of the spectrum is throwing away make and having a shell script that
just builds everything every time.  That also gives you the right
answer, so both are "objectively correct".  That doesn't mean they are
both "right".

In between are various levels of pain: adding things to the makefile
by hand, running clean builds when certain (hopefully unusual)
situations occur, etc.  These are all approximations of the perfect
solution that work better or worse depending on habits, environment,
process requirements, tools, etc.

For example, if your source code control tool modifies the directory
timestamp whenever it updates a file in that directory (say by
creating temporary files during checkout, that are then moved into place
when the checkout is complete, for atomicity) then it sucks if your
makefile depends on the directory timestamps.

If you need to edit header files in "common" directories, and your
editor makes temporary files that change directory timestamps, that
sucks as well [*].

I'm not saying that the method doesn't work or doesn't give the right
answer.  I'm saying I'm doubtful that it's a generic-enough solution
to be acceptable to a large number of build environments, for all sorts
of different reasons.  Directory timestamps are somewhat fickle things
and most people don't even know what they mean, much less think about
what does and doesn't update them.

[*] Symlink farms could help here, IF your operating system supports
them, and IF you're willing to take the hit on every build to invoke
some tool that makes sure they're up to date... if not then the basic
problem that started this thread (adding a new include file) will not
be solved since there will be no link for the new file.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]