[Top][All Lists]

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

Re: executing a rule prior to any targets?

From: Philip Guenther
Subject: Re: executing a rule prior to any targets?
Date: Sun, 20 Oct 2002 01:57:57 -0700

address@hidden (gk) writes:
>At 09:10 AM 10/19/2002 -0400, Paul D. Smith wrote:
>>>   g> * I do not want to specify 'recurse' as a command line goal; I want to
>>>   g> build $(MAKECMDGOALS) in each directory in my list:
>>>   g> recurse :
>>>   g>          @for dir in $(SUBDIRS); do\
>>>   g>                  $(MAKE) -C $$dir $(MAKECMDGOALS); \
>>>   g>          done
>>>See the GNU make manual for some reasons why doing submakes inside a
>>>loop like this is suboptimal.
>I re-read the section on recursive use of make but found nothing there.
>Could you point me to a particular section of the manual?

I don't know what Paul was referring to in the manual, but I will
suggest that you read, if you haven't already, the "Recursive Make
Considered Harmful" paper by Peter Miller:

Last winter I converted a good sized project (150 directories, building
61 libraries and 48 executables, totalling ~1000 source files) from
recursive make to whole-project make with automatic dependency
generation.  Having done so, I feel the advantages are hard to oversell,
starting with time saved by each developer not having to fight with the
build system.

(There are things I would like to change about how I made that
conversion, but when it
  a) is actually correct, dependency-wise, and
  b) takes less than two seconds to read everything and start building,
it becomes hard to justify spending much time tweaking it...)

Philip Guenther

reply via email to

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