help-make
[Top][All Lists]
Advanced

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

Question about order dependencies


From: drwowe
Subject: Question about order dependencies
Date: Sun, 13 Sep 2009 23:11:30 -0700 (PDT)

Suppose I have the following makefile:
foo: ...
   ...
bar: ...
   ...
all: foo bar

Here's the problem:  I need to make sure foo completes before bar is
started, but only if foo was going to be executed anyway.  The obvious
thing, making a dependency "bar: foo" is wrong, because the user needs to be
able to say "make bar" on the command line without building foo. 
Ordering-only dependencies seemed at first glance to be what I needed, but
it turns out that saying "bar: | foo" still forces foo to get built.

Anyway, I came up with a very ugly workaround by checking the MAKECMDGOALS
and adding "bar: foo" conditionally if "all" or "foo" is on the command
line, but I was wondering if there was an easier way to impose ordering
constraints on goals without triggering new goals?
-- 
View this message in context: 
http://www.nabble.com/Question-about-order-dependencies-tp25430782p25430782.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.





reply via email to

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