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