xref: /freebsd/contrib/bmake/unit-tests/dep-double-colon-indep.mk (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1# $NetBSD: dep-double-colon-indep.mk,v 1.1 2020/10/23 19:11:30 rillig Exp $
2#
3# Tests for the :: operator in dependency declarations, which allows multiple
4# dependency groups with the same target.  Each group is evaluated on its own,
5# independent of the other groups.
6#
7# This is useful for targets that are updatable, such as a database or a log
8# file.  Be careful with parallel mode though, to avoid lost updates and
9# other inconsistencies.
10#
11# The target 1300 depends on 1200, 1400 and 1500.  The target 1200 is older
12# than 1300, therefore nothing is done for it.  The other targets are newer
13# than 1300, therefore each of them is made, independently from the other.
14
15.END:
16	@rm -f dep-double-colon-1???
17
18_!=	touch -t 202001011200 dep-double-colon-1200
19_!=	touch -t 202001011300 dep-double-colon-1300
20_!=	touch -t 202001011400 dep-double-colon-1400
21_!=	touch -t 202001011500 dep-double-colon-1500
22
23all: dep-double-colon-1300
24
25dep-double-colon-1300:: dep-double-colon-1200
26	: 'Making 1200 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}'
27
28dep-double-colon-1300:: dep-double-colon-1400
29	: 'Making 1400 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}'
30
31dep-double-colon-1300:: dep-double-colon-1500
32	: 'Making 1500 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}'
33