mirror of
https://github.com/mirror/make.git
synced 2025-01-30 06:11:02 +08:00
* doc/make.texi (Prerequisite Types): [SV 58056] Clarify ordering.
This commit is contained in:
parent
3cb84fe933
commit
d51ac70122
@ -2075,26 +2075,25 @@ extra features (@pxref{Recipes, ,Writing Recipes in Rules}).
|
|||||||
@cindex normal prerequisites
|
@cindex normal prerequisites
|
||||||
@cindex prerequisites, order-only
|
@cindex prerequisites, order-only
|
||||||
@cindex order-only prerequisites
|
@cindex order-only prerequisites
|
||||||
There are actually two different types of prerequisites understood by
|
There are two different types of prerequisites understood by GNU @code{make}:
|
||||||
GNU @code{make}: normal prerequisites such as described in the
|
normal prerequisites, described in the previous section, and @dfn{order-only}
|
||||||
previous section, and @dfn{order-only} prerequisites. A normal
|
prerequisites. A normal prerequisite makes two statements: first, it imposes
|
||||||
prerequisite makes two statements: first, it imposes an order in which
|
an order in which recipes will be invoked: the recipes for all prerequisites
|
||||||
recipes will be invoked: the recipes for all prerequisites of a target
|
of a target will be completed before the recipe for the target is started.
|
||||||
will be completed before the recipe for the target is run. Second, it
|
Second, it imposes a dependency relationship: if any prerequisite is newer
|
||||||
imposes a dependency relationship: if any prerequisite is newer than
|
than the target, then the target is considered out-of-date and must be
|
||||||
the target, then the target is considered out-of-date and must be
|
|
||||||
rebuilt.
|
rebuilt.
|
||||||
|
|
||||||
Normally, this is exactly what you want: if a target's prerequisite is
|
Normally, this is exactly what you want: if a target's prerequisite is
|
||||||
updated, then the target should also be updated.
|
updated, then the target should also be updated.
|
||||||
|
|
||||||
Occasionally, however, you have a situation where you want to impose a
|
Occasionally you may want to ensure that a prerequisite is built before a
|
||||||
specific ordering on the rules to be invoked @emph{without} forcing
|
target, but @emph{without} forcing the target to be updated if the
|
||||||
the target to be updated if one of those rules is executed. In that
|
prerequisite is updated. @dfn{Order-only} prerequisites are used to create
|
||||||
case, you want to define @dfn{order-only} prerequisites. Order-only
|
this type of relationship. Order-only prerequisites can be specified by
|
||||||
prerequisites can be specified by placing a pipe symbol (@code{|})
|
placing a pipe symbol (@code{|}) in the prerequisites list: any prerequisites
|
||||||
in the prerequisites list: any prerequisites to the left of the pipe
|
to the left of the pipe symbol are normal; any prerequisites to the right are
|
||||||
symbol are normal; any prerequisites to the right are order-only:
|
order-only:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@var{targets} : @var{normal-prerequisites} | @var{order-only-prerequisites}
|
@var{targets} : @var{normal-prerequisites} | @var{order-only-prerequisites}
|
||||||
|
Loading…
Reference in New Issue
Block a user