Subject: Re: make: making .WAIT recursive
To: Alan Barrett <apb@cequrux.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-toolchain
Date: 02/12/2006 14:43:43
On Sun, Feb 12, 2006 at 09:08:19AM +0200, Alan Barrett wrote:
> As has been mentioned by others, .WAIT doesn't do what we want.
> 
> Given
> 
> 	foo: a .WAIT b	; echo foo
> 	a:		; echo a
> 	b: b1 b2	; echo b
> 	b1:		; echo b1
> 	b2:		; echo b2
> 
> a parallel make will always make "a" before making "b", but it will not
> always make "a" before making "b1" or "b2".
> 
> There's a similar issue with .ORDER.  Given
> 
> 	foo: a b	; echo foo
> 	.ORDER: a b
> 	a:		; echo a
> 	b: b1 b2	; echo b
> 	b1:		; echo b1
> 	b2:		; echo b2
> 
> the existing behaviour is identical to the existing behaviour 
> if the .WAIT example.
> 
> 
> Would it be reasonable to make ".WAIT" apply recursively to all children
> of the targets on the right hand side, but to leave ".ORDER" with its
> existing non-recursive behaviour?  Or would it be better to retain the
> existing behaviour of both .WAIT and .ORDER, but add new recursive
> variants of both (say ".WAITRECURSIVE" and ".ORDERRECURSIVE", or better
> names if anybody can suggest them)?

I fear that by making .WAIT and .ORDER recursive we loose a lot of
parallelism from makefiles. In your example, the fast that b1 and b2 have
to be done after a may not be always true, and if it's the case,
maybe b1 and b2 should depend on a ?
Or change it to .ORDER a b1 b2 b ?

In other words IMHO the problem is more in the makefiles than in
make itself.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--