make-w32
[Top][All Lists]
Advanced

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

RE: Making multiple projects with one makefile


From: Norris, Nelson [LBRT/LNA]
Subject: RE: Making multiple projects with one makefile
Date: Thu, 5 Aug 2004 16:53:33 -0400

I had posted this original message a couple of months ago, and got a
response.  However, after trying the proposed solution, I still get the
following error:

NEW MAKEFILE
------------

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

NEW ERROR
---------

gmake -C controlBoard; gmake -C displayBoard; gmake -C serialOptionBoard
gmake: *** controlBoard;: No such file or directory.  Stop.
gmake: *** [all] Error 2

Now the ';' separates the command into 3 separate commands, but now it tries
to pass the ';' as part of the directory name!

Is there another solution other than using the foreach command?  Or am I
still missing something?


Regards,


Nelson


------------------------------------------------
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.

MAKEDIRS = controlBoard displayBoard serialOptionBoard

all:
     $(foreach dir, $(MAKEDIRS), $(MAKE) -C $(dir))

>>RESPONSE<< $(foreach dir, $(MAKEDIRS), $(MAKE) -C $(dir);)

>>RESPONSE<< 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

This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorized to
retain, read, copy or disseminate this message or any part of it.




reply via email to

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