bug-make
[Top][All Lists]
Advanced

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

Re: Order-only prerequisites


From: Paul Smith
Subject: Re: Order-only prerequisites
Date: Wed, 07 Jun 2023 12:45:50 -0400
User-agent: Evolution 3.48.2 (by Flathub.org)

On Wed, 2023-06-07 at 04:20 +0200, Frank Heckenbach wrote:
> What I want to achieve is that a and b can be made independently,
> but when both of them are made, a is always made first. I assumed
> that's what order-only prerequisites are for

That's not what it's for.  In fact, you can't achieve that in GNU Make
(certainly not easily) or any other make I'm aware of.  That's because
such a feature would be quite difficult to implement without
fundamentally changing the way make is typically designed.

The documentation of order-only prequisites says what they're for:

> A normal prerequisite makes two statements: first, it imposes an
> order in which recipes will be invoked: the recipes for all
> prerequisites of a target will be completed before the recipe for the
> target is run.  Second, it imposes a dependency relationship: if any
> prerequisite is newer than the target, then the target is considered
> out-of-date and must be rebuilt.
> 
> [Order-only prerequisites] impose a specific ordering on the rules to
> be invoked _without_ forcing the target to be updated if one of those
> rules is executed.

Makes treats order-only prereqs identically to "normal" prereqs in
every way, EXCEPT that at the time where it checks to see whether the
target needs to be rebuilt it doesn't consider the timestamps of the
order-only prerequisites.  That's all there is.



reply via email to

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