help-make
[Top][All Lists]
Advanced

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

Re: how to do recursive "subsystem" make properly?


From: John Calcote
Subject: Re: how to do recursive "subsystem" make properly?
Date: Tue, 03 Nov 2009 14:02:40 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4

Hi Mark,

On 11/3/2009 1:54 PM, Mark Galeck (CW) wrote:

Hello,  I see the following recommendation for a “subsystem” recursive make in the gnu make manual:

 

subsystem:

             $(MAKE) -C subdir

 

 

Well, I must not be understanding something, because this does not make (no pun) sense to me… 

 

The problem I have, is that the “subsystem” target as above, will always be remaked, if only to execute make recursively and find out in fact, that everything was up to date in that subdirectory.  Then of course, everything up above, depending on the subsystem target, will also have to be remaked.  In other words, even if you don’t change anything, make will still take time to remake some things.  Clearly this is against the spirit of make. 



What you seem to be concerned about is that Make will always recurse down into subdir, even if nothing needs to be made in subdir. This is true but unavoidable, because make has to evaluate the state of subdir/Makefile in order to determine if anything has to be made in that directory. This is the nature of recursive make. If you don't want a recursive make, then just put all of your rules in the top-level Makefile.

That said, if nothing needs to be remade, the effect of recursive make is to simply run make several times - one for each sub-make - each of which do nothing more than determine that nothing needs to be done.

Regards,
John

reply via email to

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