help-make
[Top][All Lists]
Advanced

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

Re: The explanation of order-only prerequisites is not clear


From: Paul Smith
Subject: Re: The explanation of order-only prerequisites is not clear
Date: Mon, 13 Sep 2010 10:08:44 -0400

On Sun, 2010-09-12 at 09:06 +0430, ali hagigat wrote:
> The only sentence which explains order-only prerequisites is this:
> 
> "Occasionally, however, you have a situation where you want to impose
> a specific ordering on the rules to be invoked without forcing the
> target to be updated if one of those rules is executed."

The entire section must be read to understand, you cannot just search
for a given term and read the sentence or paragraph that it's contained
in, and hope to understand.

> a specific ordering on what rules?

Whatever rules you want to impose a specific ordering on.  Your makefile
has a bunch of rules.  Some of them will be related to each other via a
dependency relationship, which forces the order in which they're run.
Some won't be related.

> Suppose, we have a rule in a
> makefile and that rule has a target and some prerequisites. And those
> prerequisites have their own rules. When you talk about a specific
> order on rules, do you mean the rules of these prerequisites?
> Or you mean some unrelated independent rules in a makefile?
> What ordering mean? Does it mean they are executed first?

One of the main functions of make is to run recipes in a specific order.
It wouldn't make sense to try to link objects before you've compiled
them.  Makefiles are, essentially, one big definition of the correct
order in which things should be done during the build.

> What "without forcing the target to be updated" mean? You mean the
> recipe of that target will not be executed?

It will not be _forced_ to be executed because the order-only prereq was
updated, yes: just so.

> Paul Smith wrote: "..and nowhere in there does it talk about pipe
> symbols at all..."
> "Order-only prerequisites can be specified by placing a pipe symbol
> (|) in the prerequisites list..."
> I copied one line of the make manual. You have not mentioned the pipe symbol?

By "in there" I meant the section of the manual that I had quoted just
before that sentence, that you cut out.

Unfortunately it's not the case that we always create every single
sentence in a completely self-contained manner.  Many of our sentences
follow from, and only make sense in the context of, the previous
sentences in that paragraph or section of the manual.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "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]