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: Ian Dunbar
Subject: Re: fatal errors for missing include files.
Date: Tue, 31 Aug 2004 01:06:35 +0000

Hi Paul,

Thanks for your reply. I will try to clarify what I meant.

From: "Paul D. Smith" <address@hidden>
%% "Ian Dunbar" <address@hidden> writes:

  id> In general, making the lowest file first seems like unusual
  id> behavour. Shouldn't make know that it should regenerate included
  id> files from the top down? It seems like it is implied by the
  id> functionality of the include keyword. Otherwise it could end up
  id> re-generating a lot of unneeded include files. Or is this intended
  id> behaviour? (why?)

I'm not sure what you mean by "the top down".

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

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

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

You have removed the file (subsub.prj) that make could build the
subsub.mk file from, so when make tries to build subsub.mk it can't find
a rule to use.  So it reports that there is no rule to make that target.

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

I don't see how the order of rebuilding of makefiles can solve that
problem, since you have no rule that tells how to build a .prj file.

To be explicit: In my opinion, the fact that it can't build subsub.mk is not the problem. It's the fact that it is trying to build it in the first place.

I have updated sub.prj manually to remove the inclusion of subsub.mk, so I disagree that the order of rebuilding won't make any difference.

~> cat > sub.prj
# empty

sub.mk is now out of date, and I have a rule to build a .mk from a .prj which should be triggered by the manually updated sub.prj.

If make builds sub.mk first, it will see that it contains nothing to build, so it won't try to build subsub.mk, and so won't fail. Also, as I wrote initially adding an order only pre-requisite solves this, showing that the order of update of included files is important.

It's just my opinion that I shouldn't have to add that order only pre-requisite. The keyword "include" ought to tell make that update order is important for multiple levels of include, just by virtue of what it does.

You can disagree with my interpretation of course, but can you tell me what the justification for trying to rebuild "subsub.mk" is, when it knows that the file that includes it is out of date?

Best regards,
Ian

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail





reply via email to

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