help-make
[Top][All Lists]
Advanced

[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 12:22:04 -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.
>

Thanks for that tip.  The paper was relatively easy to read, even for
a make newbie.  I didn't think I was doing recursive make, but after
reading the paper, I realized I was.  I'll try to refactor my make
system and if there are any problems, I'll ask again.

Thanks,
Jeremy


>     cheers,
>       DaveK
> --
> Can't think of a witty .sigline today....
>
>




reply via email to

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