xref: /freebsd/contrib/bmake/unit-tests/depsrc.mk (revision 06b9b3e0ad0dc3f0166b3e8f26ced68c271cf527)
1*06b9b3e0SSimon J. Gerraty# $NetBSD: depsrc.mk,v 1.4 2020/12/22 19:38:44 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for special sources (those starting with a dot, followed by
42c3632d1SSimon 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
10*06b9b3e0SSimon J. Gerraty# Demonstrate when exactly undefined variables are expanded in a dependency
11*06b9b3e0SSimon J. Gerraty# declaration.
12*06b9b3e0SSimon J. Gerratytarget: .PHONY source-${DEFINED_LATER}
13*06b9b3e0SSimon J. Gerraty#
14*06b9b3e0SSimon J. GerratyDEFINED_LATER=	later
15*06b9b3e0SSimon J. Gerraty#
16*06b9b3e0SSimon J. Gerratysource-: .PHONY
17*06b9b3e0SSimon J. Gerraty	: 'Undefined variables are expanded directly in the dependency'
18*06b9b3e0SSimon J. Gerraty	: 'declaration.  They are not preserved and maybe expanded later.'
19*06b9b3e0SSimon J. Gerraty	: 'This is in contrast to local variables such as $${.TARGET}.'
20*06b9b3e0SSimon J. Gerratysource-later: .PHONY
21*06b9b3e0SSimon J. Gerraty	: 'Undefined variables are tried to be expanded in a dependency'
22*06b9b3e0SSimon J. Gerraty	: 'declaration.  If that fails because the variable is undefined,'
23*06b9b3e0SSimon J. Gerraty	: 'the expression is preserved and tried to be expanded later.'
24*06b9b3e0SSimon J. Gerraty
252c3632d1SSimon J. Gerratyall:
262c3632d1SSimon J. Gerraty	@:;
27