[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Making multiple projects with one makefile
From: |
Norris, Nelson [LBRT/LNA] |
Subject: |
Making multiple projects with one makefile |
Date: |
Wed, 16 Jun 2004 11:42:35 -0400 |
I am looking
for assistance in creating a makefile that will navigate a tree of directories,
and perform a build on each subdirectory.
Example:
main project
- contains a high-level makefile, that builds each of the following sub-projects
(contained in
| subdirectories
under the main project, where the project makefile is
executed)
|--- controlBoard - contains a makefile for
building it's code
|--- displayBoard - contains a makefile for
building it's code
|---
serialOptionBoard - contains a makefile for building it's
code
I have
attempted to do this using the 'foreach' function, but it won't work with
multiple subdirectories.
The main
project makefile I created contains the following:
MAKEDIRS = controlBoard displayBoard
serialOptionBoard
all:
$(foreach dir, $(MAKEDIRS), $(MAKE) -C
$(dir))
I expect it
to go to the controlBoard directory, perform a make, then go to the displayBoard
directory, perform a make, and finally go to the serialOptionBoard directory,
and perform a make.
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
gmake: Entering an unknown directory
gmake: Leaving an
unknown directory
gmake[1]: Leaving directory
`C:/_projects/mainProject'
Each of the subprojects builds correctly if I
manually go to each subdirectory and invoke GNUmake.
Regards,
Nelson J. Norris
Senior Design Engineer,
Software
Liebert Corporation - UPS
Engineering
Phone : (614) 841-5412
Fax : (614)
841-5472
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.
|
- Making multiple projects with one makefile,
Norris, Nelson [LBRT/LNA] <=