xref: /freebsd/contrib/bmake/unit-tests/cmd-errors-lint.mk (revision 397e83df75e0fcd0d3fcb95ae4d794cb7600fc89)
1# $NetBSD: cmd-errors-lint.mk,v 1.2 2024/04/23 22:51:28 rillig Exp $
2#
3# Demonstrate how errors in expressions affect whether the commands
4# are actually executed.
5
6.MAKEFLAGS: -dL
7
8all: undefined unclosed-expression unclosed-modifier unknown-modifier end
9
10# Undefined variables in expressions are not an error.  They expand to empty
11# strings.
12undefined:
13	: $@ ${UNDEFINED}
14
15# XXX: As of 2020-11-01, this obvious syntax error is not detected.
16# XXX: As of 2020-11-01, this command is executed even though it contains
17# parse errors.
18unclosed-expression:
19	: $@ ${UNCLOSED
20
21# XXX: As of 2020-11-01, this obvious syntax error is not detected.
22# XXX: As of 2020-11-01, this command is executed even though it contains
23# parse errors.
24unclosed-modifier:
25	: $@ ${UNCLOSED:
26
27# XXX: As of 2020-11-01, this command is executed even though it contains
28# parse errors.
29unknown-modifier:
30	: $@ ${UNKNOWN:Z}
31
32end:
33	: $@
34