bug-make
[Top][All Lists]
Advanced

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

Re: fatal errors for missing include files.


From: Paul D. Smith
Subject: Re: fatal errors for missing include files.
Date: Mon, 30 Aug 2004 21:44:01 -0400

%% "Ian Dunbar" <address@hidden> writes:

  id> I mean make would build "includer" files before "includee" files.
  id> So if I have this kind of structure, where indentation indicates
  id> incusion level:

  id> Makefile
  id>   includes sub.mk
  id>     includes subsub.mk
  id>       includes subsubsub.mk
  id>          etc.

Hm.  Well, make doesn't really think of include files that way, at least
not after the files are read in.  It just has a list of files that were
read; there's no structure to that list that would describe which files
were included inside others.

Obviously, such a structure could be kept, but it is not present now.

  id> It would know that the order of making up to date has to be:
  id> Makefile, sub.mk, subsub.mk, subsubsub.mk, etc., because if sub.mk
  id> is out of date, there is no guarentee that the soon to be updated
  id> version will include the same files as before.

Ah.  There is an even deeper misunderstanding here.

Note that when remaking makefiles, make does _NOT_ proceed like this:

    load first.mk
    load second.mk
    load third.mk
    remake first.mk
    reload first.mk
    remake second.mk
    reload second.mk
    remake third.mk
    reload third.mk

Instead, make works like this:

    load first.mk
    load second.mk
    load third.mk
    remake first.mk
    remake second.mk
    remake third.mk
    start the entire program over, which starts reading again.

  id> Which is quite correct, and I am not complaining about that. I am
  id> just saying that since it knows sub.mk is out of date, and so make
  id> shouldn't be trying to build anything included from it until it
  id> has been updated.

This doesn't matter though: remaking sub.mk in no way changes the rules,
variables, etc. that make knows about because the makefile is not
re-read immediately after it's created.  So, if there were no rules to
build that target before sub.mk was rebuilt, there cannot be any
afterwards either.

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