2023-01-28 00:23:54 +00:00
|
|
|
# $NetBSD: cmd-errors.mk,v 1.5 2022/09/25 12:51:37 rillig Exp $
|
2020-11-20 03:54:37 +00:00
|
|
|
#
|
|
|
|
# Demonstrate how errors in variable expansions affect whether the commands
|
2021-01-14 01:24:34 +00:00
|
|
|
# are actually executed in compat mode.
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
all: undefined unclosed-variable unclosed-modifier unknown-modifier end
|
|
|
|
|
|
|
|
# Undefined variables are not an error. They expand to empty strings.
|
|
|
|
undefined:
|
2023-01-28 00:23:54 +00:00
|
|
|
: $@-${UNDEFINED}-eol
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
# XXX: As of 2020-11-01, this command is executed even though it contains
|
|
|
|
# parse errors.
|
|
|
|
unclosed-variable:
|
2023-01-28 00:23:54 +00:00
|
|
|
: $@-${UNCLOSED
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
# XXX: As of 2020-11-01, this command is executed even though it contains
|
|
|
|
# parse errors.
|
|
|
|
unclosed-modifier:
|
2023-01-28 00:23:54 +00:00
|
|
|
: $@-${UNCLOSED:
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
# XXX: As of 2020-11-01, this command is executed even though it contains
|
|
|
|
# parse errors.
|
|
|
|
unknown-modifier:
|
2023-01-28 00:23:54 +00:00
|
|
|
: $@-${UNKNOWN:Z}-eol
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
end:
|
2023-01-28 00:23:54 +00:00
|
|
|
: $@-eol
|
2020-11-20 03:54:37 +00:00
|
|
|
|
|
|
|
# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.
|