help-make
[Top][All Lists]
Advanced

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

Re: Multiple-dir make.


From: John Graham-Cumming
Subject: Re: Multiple-dir make.
Date: Thu, 12 May 2005 12:47:55 -0400

On Thu, 2005-05-12 at 18:23 +0200, Andrea Riciputi wrote:
> I've tried to get it with make, but without success, neither googling 
> the Net helped. Is it possible to get this behavior with make? How?

I assume that your project is organized with separate Makefiles within
each directory.   It's hard for Make to know the links between those
Makefiles when they are separate.  There are really two approaches to
fixing this problem:

1. Create a top-level Makefile at the highest level in the tree that
does understand the dependencies between the sub-projects and do the
Make from there.  The GNU Make manual gives a recipe for this type of
recursive Make in the section on "Phony Targets".

2. Remove recursive use of Make entirely and have a single Makefile that
encompasses the full build and hence can have dependencies between
modules specified in it.  I recently wrote an article about this style
for Dr. Dobbs which you can find in here: http://www.electric-
cloud.com/resources/ (It's entitled Cross Platform Builds), or look for
the July Linux Magazine where I have an article on eliminating recursive
Make.

John.
-- 
John Graham-Cumming

Home: http://www.jgc.org/
Work: http://www.electric-cloud.com/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/






reply via email to

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