Subject: toolchain/20828: make: .WAIT doesn't work if macro expansion needed.
To: None <>
From: None <>
List: netbsd-bugs
Date: 03/20/2003 18:06:35
>Number:         20828
>Category:       toolchain
>Synopsis:       make: .WAIT doesn't work if macro expansion needed.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    sjg
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 20 18:07:01 PST 2003
>Originator:     Simon J. Gerraty
>Release:        NetBSD 1.6_STABLE
Zen Programming...
System: NetBSD 1.6_STABLE NetBSD 1.6_STABLE (CRUFTY) #0: Sun Nov 10 16:37:28 PST 2002 i386
Architecture: i386
Machine: i386

Given the makefile below, make -j4 ok and make -j4 maybe
will correctly wait for three and six to complete before doing 
ok-fin, but make -j4 not, will run not-fin in parallel 
with three and six.

one two three four:
	@echo Start $@; sleep 6; echo Finished $@

five six seven ok-fin not-fin:
	@echo Start $@; sleep 3; echo Finished $@

ok:	three six .WAIT ok-fin

not:	three six .WAIT $@-fin


maybe:	three six .WAIT ${MAYBE}

This is with -current make as of today.
For a laugh try:

$ make -f /homes/sjg/make-tests/jobs-wait -j4 maybe not ok
--- three ---
--- six ---
--- not-fin ---
--- three ---
Start three
--- six ---
Start six
--- not-fin ---
Start not-fin
--- six ---
Finished six
--- not-fin ---
Finished not-fin
--- three ---
Finished three
--- ok-fin ---
Start ok-fin
Finished ok-fin