On Thu, 2025-03-06 at 13:28 -0900, Britton Kerin wrote: > In this example, I would not expect bar to be updated due to > actual_source when foo is requested. The timestamp dependency chain > should be broken between foo and bar and Make should be able to > figure that out when handling an explicit request for foo. Is this a > bug? > > $ cat Makefile > foo: | bar > cp $| $@ > > bar: actual_source > cp $< $@ > > clean: > rm -f foo bar
Possibly I'm misunderstanding your test case but none of the results you showed look wrong to me. Order-only prerequisites are defined in what I hope is a clear way in this paragraph: https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html#index-order_002donly-prerequisites I'm not sure what you mean exactly by "the timestamp dependency chain should be broken", but nothing about the order-only status of the prerequisites of "foo" makes any difference when deciding whether to build "bar". It only impacts "foo". If make considers "bar" for any reason, then it will be rebuilt if it is out of date. The only difference between making "bar" and order-only prereq vs. a normal prereq of "foo", is whether "foo" is updated or not when "foo" is out of date with respect to "bar". Every other aspect of this makefile behaves the same regardless. "Order-only" means that the prerequisite is only considered to define an order of build operation, but doesn't impact the out-of-date calculations of its target.