bug-make
[Top][All Lists]
Advanced

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

Re: 'How makefiles are remade'


From: Jim
Subject: Re: 'How makefiles are remade'
Date: Wed, 21 Apr 2004 05:35:11 -0700
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

Paul D. Smith wrote:

The reality is that GNU make is not designed to behave the way you want
it to behave.  It's designed to work like this:

 1) All makefiles are read in (the main makefile, included makefiles,
    stuff in MAKEFILES, etc.)

 2) Make examines every makefile that it read in and tries to rebuild
    it.

 3) If the result of step #2 is that _any_ of the makefiles were
    rebuilt, make re-execs itself.

 4) If we get here, no makefile was remade, so continue with normal make
    processing.

Making it work the way you want (if I understand you correctly), where
steps 2 and 3 are performed in a loop so that the re-exec happens

yeah :)

immediately when each makefile is rebuilt instead of after all the
makefiles are rebuilt, is simply not the way make is designed.  Trying
to make it behave this way is extremely tricky, as shown by my example.

In fact, I think the documentation is quite clear on this point.  This
is the second paragraph in the section "How Makefiles are Remade", which
is where this entire feature is described:

Oooh ...

     To this end, after reading in all makefiles, `make' will consider
  each as a goal target and attempt to update it.  If a makefile has a
  rule which says how to update it (found either in that very makefile or
  in another one) or if an implicit rule applies to it (*note Using
  Implicit Rules: Implicit Rules.), it will be updated if necessary.
  After all makefiles have been checked, if any have actually been
    (this part right here...)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]