bug-make
[Top][All Lists]
Advanced

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

Re: make doesn't always reread included makefiles


From: Paul D. Smith
Subject: Re: make doesn't always reread included makefiles
Date: Tue, 11 Feb 2003 16:24:27 -0500

%% Paul Franklin <address@hidden> writes:

  pf> Under certain circumstances, make fails to notice that one or more
  pf> included makefiles have changed and does not restart and reread
  pf> makefiles.

This is a complex problem.  Here is what happens:

First, make tries to rebuild Make.b (it generally tries to rebuild files
in the reverse order in which they are seen in the makefile; this is an
accident of implementation).  It sees that in order to build Make.b it
needs to build Make.a, so it does.

Then the rule to build Make.b doesn't actually change Make.b (it just
prints a line) so make sees that Make.b was not updated, and it won't
schedule a re-exec because of that.

Then make looks at the next makefile, Make.a, and it sees that it has
already tried to build Make.a (as a side-effect of Make.b) so make
ignores it.

Then it tries to build the main makefile, and there's no rule for that.

So, it gets to the end and decides that none of the makefiles was
rebuilt, and it doesn't re-exec.

The error here is that make should notice Make.a was rebuilt even though
it was done as a side-effect of another build.

If you changed your rule for Make.b to actually update the file Make.b,
or you switched the include lines around so that Make.a was included
after Make.b instead of before, or you removed the dependency of Make.b
on Make.a, then it would work.

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