11.4Srillig# $NetBSD: depsrc-wait.mk,v 1.4 2022/05/07 17:49:47 rillig Exp $
21.1Srillig#
31.3Srillig# Tests for the special source .WAIT in dependency declarations,
41.3Srillig# which adds a sequence point between the nodes to its left and the nodes
51.3Srillig# to its right.
61.1Srillig
71.4Srilligall: .PHONY
81.4Srillig	@${MAKE} -r -f ${MAKEFILE} x
91.4Srillig	@${MAKE} -r -f ${MAKEFILE} three-by-three
101.4Srillig
111.4Srillig
121.4Srillig.if make(x)
131.3Srillig# Even though the build could run massively parallel, the .WAIT imposes a
141.3Srillig# strict ordering in this example, which forces the targets to be made in
151.3Srillig# exactly this order.
161.3Srillig.MAKEFLAGS: -j8
171.1Srillig
181.3Srillig# This is the example from the manual page.
191.3Srillig.PHONY: x a b b1
201.3Srilligx: a .WAIT b
211.3Srillig	echo x
221.3Srilliga:
231.3Srillig	echo a
241.3Srilligb: b1
251.3Srillig	echo b
261.3Srilligb1:
271.3Srillig	echo b1
281.4Srillig.endif
291.4Srillig
301.4Srillig
311.4Srillig# There are 3 groups of 3 targets, with .WAIT barriers in between.  Each of
321.4Srillig# these groups has to be made completely before starting the next group.
331.4Srillig# See Makefile, POSTPROC for the postprocessing that takes place.
341.4Srillig.if make(three-by-three)
351.4Srillig.MAKEFLAGS: -j5
361.4Srillig.MAKE.MODE+=	randomize-targets
371.4Srillig
381.4Srilligthree-by-three: .WAIT 3a1 3a2 3a3 .WAIT 3b1 3b2 3b3 .WAIT 3c1 3c2 3c3 .WAIT
391.4Srillig3a1 3a2 3a3 3b1 3b2 3b3 3c1 3c2 3c3:
401.4Srillig	: Making ${.TARGET}
411.4Srillig.endif
42