tech-toolchain archive

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

Re: make: ignore stale .depend



On Fri, Nov 26, 2010 at 04:57:05PM -0800, Simon J. Gerraty wrote:
 > >Can we please instead try to figure out the real issue underlying the
 > >overtly visible problem, and come up with a proper fix for that?
 > 
 > The problem is that 'mkdep' puts the path of .c files into .depend

In that case, the fix is to change mkdep :-) but I don't see that this
is the real problem.

The real problem is that the list of files on the right-hand-side of a
.depend line is a derived piece of data, it's out of date with respect
to its source information, and it's not getting rebuilt at the right
time.

The only proper fix is to express that dependency correctly and let
the normal mechanisms of make take care of it. Trying to hack around
it instead is asking for problems, both in the makefile frameworks and
(to the extent the hacking goes into make) in make itself.

gmake has a feature that lets it rebuild and rescan included makefile
fragments that are out of date; ISTM that this, combined with correct
rules for the .depend and *.d files (which we do not currently have),
should solve the problem completely and permanently.

There is no need to treat rules read from .depend in a special way and
we really ought to remove that logic.

-- 
David A. Holland
dholland%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index