help-make
[Top][All Lists]
Advanced

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

build top level sources before specific target???


From: Kevin
Subject: build top level sources before specific target???
Date: Thu, 29 Oct 2009 23:55:18 -0400

I have a project organized as this:
================================
Top level directory sources: top1.c top2.c top3.c ......
   2nd level directory sources: second1.c second2.c .....
================================

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??

Thanks!

Kevin




reply via email to

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