xref: /freebsd/contrib/bmake/unit-tests/depsrc-wait.mk (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1# $NetBSD: depsrc-wait.mk,v 1.4 2022/05/07 17:49:47 rillig Exp $
2#
3# Tests for the special source .WAIT in dependency declarations,
4# which adds a sequence point between the nodes to its left and the nodes
5# to its right.
6
7all: .PHONY
8	@${MAKE} -r -f ${MAKEFILE} x
9	@${MAKE} -r -f ${MAKEFILE} three-by-three
10
11
12.if make(x)
13# Even though the build could run massively parallel, the .WAIT imposes a
14# strict ordering in this example, which forces the targets to be made in
15# exactly this order.
16.MAKEFLAGS: -j8
17
18# This is the example from the manual page.
19.PHONY: x a b b1
20x: a .WAIT b
21	echo x
22a:
23	echo a
24b: b1
25	echo b
26b1:
27	echo b1
28.endif
29
30
31# There are 3 groups of 3 targets, with .WAIT barriers in between.  Each of
32# these groups has to be made completely before starting the next group.
33# See Makefile, POSTPROC for the postprocessing that takes place.
34.if make(three-by-three)
35.MAKEFLAGS: -j5
36.MAKE.MODE+=	randomize-targets
37
38three-by-three: .WAIT 3a1 3a2 3a3 .WAIT 3b1 3b2 3b3 .WAIT 3c1 3c2 3c3 .WAIT
393a1 3a2 3a3 3b1 3b2 3b3 3c1 3c2 3c3:
40	: Making ${.TARGET}
41.endif
42