xref: /freebsd/contrib/bmake/unit-tests/depsrc.mk (revision 9f45a3c8c82ffead7044ae836d9257113c630d3b)
1*9f45a3c8SSimon J. Gerraty# $NetBSD: depsrc.mk,v 1.5 2021/12/13 23:38:54 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for special sources (those starting with a dot, followed by
4*9f45a3c8SSimon J. Gerraty# uppercase letters) in dependency declarations, such as '.PHONY'.
52c3632d1SSimon J. Gerraty
62c3632d1SSimon J. Gerraty# TODO: Implementation
72c3632d1SSimon J. Gerraty
8e2eeea75SSimon J. Gerraty# TODO: Test 'target: ${:U.SILENT}'
9e2eeea75SSimon J. Gerraty
1006b9b3e0SSimon J. Gerraty# Demonstrate when exactly undefined variables are expanded in a dependency
1106b9b3e0SSimon J. Gerraty# declaration.
1206b9b3e0SSimon J. Gerratytarget: .PHONY source-${DEFINED_LATER}
1306b9b3e0SSimon J. Gerraty#
1406b9b3e0SSimon J. GerratyDEFINED_LATER=	later
1506b9b3e0SSimon J. Gerraty#
1606b9b3e0SSimon J. Gerratysource-: .PHONY
17*9f45a3c8SSimon J. Gerraty	# This section applies.
1806b9b3e0SSimon J. Gerraty	: 'Undefined variables are expanded directly in the dependency'
1906b9b3e0SSimon J. Gerraty	: 'declaration.  They are not preserved and maybe expanded later.'
2006b9b3e0SSimon J. Gerraty	: 'This is in contrast to local variables such as $${.TARGET}.'
2106b9b3e0SSimon J. Gerratysource-later: .PHONY
22*9f45a3c8SSimon J. Gerraty	# This section doesn't apply.
2306b9b3e0SSimon J. Gerraty	: 'Undefined variables are tried to be expanded in a dependency'
2406b9b3e0SSimon J. Gerraty	: 'declaration.  If that fails because the variable is undefined,'
2506b9b3e0SSimon J. Gerraty	: 'the expression is preserved and tried to be expanded later.'
2606b9b3e0SSimon J. Gerraty
27*9f45a3c8SSimon J. Gerraty# Sources that look like keywords but are not known are interpreted as
28*9f45a3c8SSimon J. Gerraty# ordinary sources.
29*9f45a3c8SSimon J. Gerratytarget: .UNKNOWN
30*9f45a3c8SSimon J. Gerraty
31*9f45a3c8SSimon J. Gerraty.UNKNOWN:
32*9f45a3c8SSimon J. Gerraty	: Making ${.TARGET} from ${.ALLSRC:S,^$,nothing,W}.
33