help-make
[Top][All Lists]
Advanced

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

Re: build top level sources before specific target???


From: Philip Guenther
Subject: Re: build top level sources before specific target???
Date: Thu, 29 Oct 2009 21:18:33 -0700

On Thursday, October 29, 2009, Kevin <address@hidden> wrote:
...
> My makefile looks like this:
> ================================
> all: target1 target2
>
> target1: depend
>    command1
>
> target2:
>    command2
> .....
> ================================
>
>
> Now, I want simply build "target2", so I issue a command like this:
> ================================
> $ make target2
> ================================
>
> I expect "command2" to be run directly since there is no dependencies for 
> "target2", however, GNU make always compile my top level sources before 
> executing "command2".
>
> I am sure command2 is only to compile sources in 2nd level directory, and it 
> has nothing to do with sources in top level directory (top1.c top2.c ....). I 
> just wonder why GNU make always compile top level sources? and how to avoid 
> this and simply executing "command2"?
>
> Any suggestion??

With the makefile you show, that shouldn't happen.  Can you show us
your *real* makefile instead of something similar too but not exactly
the same as it?

(You don't know what causes the behavior; why do you think you know
what can be left out of the makefile that's causing your problem?
Doesn't knowing what can left out imply knowing what is causing the
problem?  Don't feel bad; I've seen this all over the place.  I'm just
wondering why it is that people leave out so much information when
asking for assistance.)


Philip Guenther




reply via email to

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