help-make
[Top][All Lists]
Advanced

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

Re: Making multiple projects with one makefile


From: Steve Byan
Subject: Re: Making multiple projects with one makefile
Date: Thu, 17 Jun 2004 10:57:46 -0400


On Jun 16, 2004, at 11:42 AM, Norris, Nelson [LBRT/LNA] wrote:

I am looking for assistance in creating a makefile that will navigate a tree of directories, and perform a build on each subdirectory.

[snip]

MAKEDIRS = controlBoard displayBoard serialOptionBoard
all:
    $(foreach dir, $(MAKEDIRS), $(MAKE) -C $(dir))
        $(foreach dir, $(MAKEDIRS), $(MAKE) -C $(dir);)

Note the semicolon before the final close-paren.

The response I get back from GNUmake is the following text:
 
gmake[1]: Entering directory `C:/_projects/mainProject'
gmake -C controlBoard  gmake -C displayBoard  gmake -C serialOptionBoard

What you wanted was:

gmake -C controlBoard;  gmake -C displayBoard;  gmake -C serialOptionBoard;

The lack of the semicolons causes the shell to interpret all the tokens following "controlBoard" as arguments to the first gmake command. The second "-C" argument to gmake causes it to try to descend into the controlBoard/displayBoard subdirectory, which doesn't exist, hence the error messages:
gmake: Entering an unknown directory
gmake: Leaving an unknown directory

Regards,
-Steve
--------
Steve Byan <address@hidden>
Software Architect
Egenera, Inc.
165 Forest Street
Marlboro, MA 01752
(508) 858-3125





reply via email to

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