[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Are prerequisites made in deterministic order when parallelism is di
Re: Are prerequisites made in deterministic order when parallelism is disabled?
Wed, 14 Jun 2017 07:00:05 +0000
Brett Stahlman (13 June 2017 17:33)
> I don't see anything in the Make docs that guarantees prerequisites
> will be processed in left to right order. Opinions on the web seems to
> be split into 2 camps:
> 1. Make always builds dependencies in left to right order, but a
> well-designed Makefile won't rely upon it.
> 2. Make is free to build dependencies in any order it likes, provided
> it respects the stated dependencies.
> My own recent experience suggests #2 is the correct statement, but I
> can't rule out the possibility that a bug in my Makefile is producing
> the apparent non-determinism I'm observing. At any rate, can anyone
> point me to a definitive source on this?
I suspect most implementations of make do in fact build in left-to-right
order but none guarantee it; and I won't be surprised if GNU make used
to but has lately stopped doing so, although I can't give you a
definitive source either way. I certainly wouldn't ever assume
deterministic build order; if one prerequisite needs to be built before
another, the make-file should express that via a dependency (perhaps
just an order-only one).