| @@ -1,24 +1,32 @@ | | | @@ -1,24 +1,32 @@ |
1 | # $NetBSD: cmd-errors.mk,v 1.1 2020/11/02 20:20:42 rillig Exp $ | | 1 | # $NetBSD: cmd-errors.mk,v 1.2 2020/11/02 20:37:50 rillig Exp $ |
2 | # | | 2 | # |
3 | # Demonstrate how errors in variable expansions affect whether the commands | | 3 | # Demonstrate how errors in variable expansions affect whether the commands |
4 | # are actually executed. | | 4 | # are actually executed. |
5 | | | 5 | |
6 | all: undefined unclosed unknown-modifier end | | 6 | all: undefined unclosed-variable unclosed-modifier unknown-modifier end |
7 | | | 7 | |
8 | # Undefined variables are not an error. They expand to empty strings. | | 8 | # Undefined variables are not an error. They expand to empty strings. |
9 | undefined: | | 9 | undefined: |
10 | : $@ ${UNDEFINED} | | 10 | : $@ ${UNDEFINED} |
11 | | | 11 | |
12 | # XXX: As of 2020-11-01, this obvious syntax error is not detected. | | 12 | # XXX: As of 2020-11-01, this obvious syntax error is not detected. |
13 | # XXX: As of 2020-11-01, this command is executed even though it contains | | 13 | # XXX: As of 2020-11-01, this command is executed even though it contains |
14 | # parse errors. | | 14 | # parse errors. |
15 | unclosed: | | 15 | unclosed-variable: |
| | | 16 | : $@ ${UNCLOSED |
| | | 17 | |
| | | 18 | # XXX: As of 2020-11-01, this obvious syntax error is not detected. |
| | | 19 | # XXX: As of 2020-11-01, this command is executed even though it contains |
| | | 20 | # parse errors. |
| | | 21 | unclosed-modifier: |
16 | : $@ ${UNCLOSED: | | 22 | : $@ ${UNCLOSED: |
17 | | | 23 | |
18 | # XXX: As of 2020-11-01, this command is executed even though it contains | | 24 | # XXX: As of 2020-11-01, this command is executed even though it contains |
19 | # parse errors. | | 25 | # parse errors. |
20 | unknown-modifier: | | 26 | unknown-modifier: |
21 | : $@ ${UNKNOWN:Z} | | 27 | : $@ ${UNKNOWN:Z} |
22 | | | 28 | |
23 | end: | | 29 | end: |
24 | : $@ | | 30 | : $@ |
| | | 31 | |
| | | 32 | # XXX: As of 2020-11-02, despite the parse errors, the exit status is 0. |