help-make
[Top][All Lists]
Advanced

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

Re: do PHONY targets guarantee an order on dependency processing?


From: Paul D. Smith
Subject: Re: do PHONY targets guarantee an order on dependency processing?
Date: Sat, 11 Feb 2006 17:19:58 -0500

%% "Robert P. J. Day" <address@hidden> writes:

  rpjd> $(Program): build_msg ... other targets ...
  rpjd> ...
  rpjd> .PHONY: build_msg
  rpjd> build_msg:
  rpjd>         @printf blah blah

  rpjd> below this snippet, it reads:

  rpjd> "Because the printf is in a phony target, the message is printed
  rpjd> immediately before any prerequisites are updated."

  rpjd> really?  i thought there was no way to guarantee the order of
  rpjd> dependency processing.  are phony targets special in this
  rpjd> respect?  or is the book just wrong?

If you run make without -j, then prerequisites are guaranteed to be
updated in the order in which they appear.

If you run make with -j, then although make will still update them in
the order in which they appear, because they are run at the same time
you can't tell for sure which ones the operating system will schedule
first.


However, the comment is definitely confusing.  There's nothing special
about .PHONY in this respect; it has nothing to do with the order in
which things happen.  I expect they're just saying that the message will
always be printed, even if you have a file named build_msg.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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