Subject: Re: make: making .WAIT recursive
To: Chuck Silvers , Alan Barrett <apb@cequrux.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-toolchain
Date: 02/13/2006 23:55:31
On Mon, Feb 13, 2006 at 10:17:51PM +0000, David Laight wrote:
> On Mon, Feb 13, 2006 at 11:10:23AM +0100, Manuel Bouyer wrote:
> > 
> > But, still, .WAIT introduce dependancies between targets of the same Makefile,
> > so I can't see why we can't make these targets depend on each others.
> > For example, we have in etc/Makefile:
> > distribution: .PHONY check_DESTDIR .WAIT distrib-dirs
> > 
> > As distrib-dirs depends on check_DESTDIR I don't see why .WAIT is needed here
> > (check_DESTDIR in this target shouldn't even be needed).
> 
> That is actaully the crux of the problem.
>     a: b .WAIT c
>     c: d
> ends up being equivalent to
>     a: b c
>     c: b d
> and nothing stops make building 'b' and 'd' at the same time.
> 
> However there are many cases where you need to have build 'b' before
> 'c' can build, but working out whether to build 'b' is expensive, and
> you need to build 'c' much more often.
> Then the makefiles needs three targets that:
> 1) builds just 'b'
> 2) builds 'c' assuming that 'b' is correctly made
> 3) builds both 'b' and 'c'
> 
> The target for '3' is the one that causes grief.

OK, I agree that .WAIT is usefull for such case. I'm just saying that
we should not abuse .WAIT when the real problem is a missing dependancy.

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