help-make
[Top][All Lists]
Advanced

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

Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5]


From: Sam Ravnborg
Subject: Re: recursive make [Was: Help-make Digest, Vol 77, Issue 5]
Date: Sun, 12 Apr 2009 01:17:49 +0200
User-agent: Mutt/1.4.2.1i

On Sat, Apr 11, 2009 at 05:42:18PM -0400, Michael R. Head wrote:
> On Sat, 2009-04-11 at 12:27 -0700, Philip Guenther wrote:
> > Since you don't describe the goal of that rule and it doesn't work as
> > is, I'm neither sure how to correct it nor what gain you think it
> > would provide.  It looks like you're trying to filter out SUBDIRS
> > entries that don't actually have files in them, but why would you have
> > added those to SUBDIRS to begin with?
> 
> You're right. I was unclear. 
> 
> The idea is to declare that a given subdirectory is dependent on just
> the files contained within it. Thus, the recursive make call should only
> be rebuilt when those dependencies are newer than the directory. I'm
> probably missing something glaringly obvious, though... 
> 
> > (If you're really concerned about the overhead or extra output
> > generated by recursive make, then why not try the non-recursive
> > approach?)
> 
> Indeed, that's probably the best thing to do for most projects. 
> 
> But the way I have my modules structured, I want the subdirectories to
> be independent of a top level make (top level projects contain papers,
> subdirectories contain test results, diagrams, and bibliographies). Each
> subdirectory is shared (in CVS as an '&' module in the CVSROOT/modules
> file) across multiple top level directories.

I you do not go for the non-recursive approach you can add
a simple:
all:
        @:

In all child Makefiles.

And if you want to build foo you just add:
all: foo

To avoid too much noise from make itself
you add in the top-level Makefile:
# Do not print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory

        Sam




reply via email to

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