aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/depsrc.mk
blob: 4e5752c97184cfbc893d7892f2b742bd0b7b269d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# $NetBSD: depsrc.mk,v 1.5 2021/12/13 23:38:54 rillig Exp $
#
# Tests for special sources (those starting with a dot, followed by
# uppercase letters) in dependency declarations, such as '.PHONY'.

# TODO: Implementation

# TODO: Test 'target: ${:U.SILENT}'

# Demonstrate when exactly undefined variables are expanded in a dependency
# declaration.
target: .PHONY source-${DEFINED_LATER}
#
DEFINED_LATER=	later
#
source-: .PHONY
	# This section applies.
	: 'Undefined variables are expanded directly in the dependency'
	: 'declaration.  They are not preserved and maybe expanded later.'
	: 'This is in contrast to local variables such as $${.TARGET}.'
source-later: .PHONY
	# This section doesn't apply.
	: 'Undefined variables are tried to be expanded in a dependency'
	: 'declaration.  If that fails because the variable is undefined,'
	: 'the expression is preserved and tried to be expanded later.'

# Sources that look like keywords but are not known are interpreted as
# ordinary sources.
target: .UNKNOWN

.UNKNOWN:
	: Making ${.TARGET} from ${.ALLSRC:S,^$,nothing,W}.