[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to execute targets in Makefile-A from Makefile-B?
From: |
Jeremy Conlin |
Subject: |
Re: How to execute targets in Makefile-A from Makefile-B? |
Date: |
Thu, 15 Nov 2007 13:58:25 -0500 |
On Nov 15, 2007 11:26 AM, Dave Korn <address@hidden> wrote:
> On 15 November 2007 16:13, Jeremy Conlin wrote:
>
> > I have the file structure as shown below.
B.cpp includes A.h so
> > whenever I compile B.cpp, I want to check if A.h and A.cpp have been
> > updated and compile them if necessary. I could create a target in
> > Makefile-B that would recompile
A.cpp if needed, but this target
> > already exists in Makefile-A. Is there anyway I could just execute
> > the target in Makefile-A when my target in Makefile-B finds a need to
> > update it?
>
> > RootDir/
> > PartA/
> > Makefile-A
> > A.cpp
> > A.h
> > PartB/
> > Makefile-B
> > B.cpp
> >
B.h
> > PartC/
> > Makefile-C
> > C.cpp
> > C.h
>
> You need to read the classic paper "Recursive Make considered harmful",
> available from
http://aegis.sourceforge.net/auug97.pdf, to really appreciate
> the problems you're going to run into here.
OK so either this isn't as obvious as I had thought, or I'm a real newbie. After refactoring my Makefile (trying to follow the suggestions) now I can't even do the simplest thing. I have a directory structure
src/
Particle/
module.mk
Particle.cpp
Particle.h
test/
module.mk
test_Particle.cpp //Includes main()
AnotherDirectory/
All I want to do (initially) is make a Particle.o file in the Particle directory, but I can't get make to do this. Of course eventually I want to link Particle.o and test_Particle.cpp, but I can't get the simpler step yet. I'm really at a loss here. I had a (recursive) make system working before (even though it wasn't great). Can someone help out a newbie? I have included my top-level Makefile and also the Particle/module.mk.
Thanks,
Jeremy
Makefile
Description: Binary data
module.mk
Description: Binary data