| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: directive-undef.mk,v 1.9 2020/12/22 20:10:21 rillig Exp $ | | 1 | # $NetBSD: directive-undef.mk,v 1.10 2021/02/16 18:02:19 rillig Exp $ |
2 | # | | 2 | # |
3 | # Tests for the .undef directive. | | 3 | # Tests for the .undef directive. |
4 | # | | 4 | # |
5 | # See also: | | 5 | # See also: |
6 | # directive-misspellings.mk | | 6 | # directive-misspellings.mk |
7 | | | 7 | |
8 | # Before var.c 1.737 from 2020-12-19, .undef only undefined the first | | 8 | # Before var.c 1.737 from 2020-12-19, .undef only undefined the first |
9 | # variable, silently skipping all further variable names. | | 9 | # variable, silently skipping all further variable names. |
10 | # | | 10 | # |
11 | # Before var.c 1.761 from 2020-12-22, .undef complained about too many | | 11 | # Before var.c 1.761 from 2020-12-22, .undef complained about too many |
12 | # arguments. | | 12 | # arguments. |
13 | # | | 13 | # |
14 | # Since var.c 1.761 from 2020-12-22, .undef handles multiple variable names | | 14 | # Since var.c 1.761 from 2020-12-22, .undef handles multiple variable names |
| @@ -76,15 +76,32 @@ ${DOLLAR}= dollar | | | @@ -76,15 +76,32 @@ ${DOLLAR}= dollar |
76 | .if defined(${DOLLAR}) | | 76 | .if defined(${DOLLAR}) |
77 | . error | | 77 | . error |
78 | .endif | | 78 | .endif |
79 | | | 79 | |
80 | | | 80 | |
81 | # Since var.c 1.762 from 2020-12-22, parse errors in the argument should be | | 81 | # Since var.c 1.762 from 2020-12-22, parse errors in the argument should be |
82 | # properly detected and should stop the .undef directive from doing any work. | | 82 | # properly detected and should stop the .undef directive from doing any work. |
83 | # | | 83 | # |
84 | # As of var.c 1.762, this doesn't happen though because the error handling | | 84 | # As of var.c 1.762, this doesn't happen though because the error handling |
85 | # in Var_Parse and Var_Subst is not done properly. | | 85 | # in Var_Parse and Var_Subst is not done properly. |
86 | .undef ${VARNAMES:L:Z} | | 86 | .undef ${VARNAMES:L:Z} |
87 | | | 87 | |
88 | | | 88 | |
| | | 89 | UT_EXPORTED= exported-value |
| | | 90 | .export UT_EXPORTED |
| | | 91 | .if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "exported-value" |
| | | 92 | . error |
| | | 93 | .endif |
| | | 94 | .if !${.MAKE.EXPORTED:MUT_EXPORTED} |
| | | 95 | . error |
| | | 96 | .endif |
| | | 97 | .undef UT_EXPORTED # XXX: does not update .MAKE.EXPORTED |
| | | 98 | .if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "not-exported" |
| | | 99 | . error |
| | | 100 | .endif |
| | | 101 | .if ${.MAKE.EXPORTED:MUT_EXPORTED} |
| | | 102 | . warning UT_EXPORTED is still listed in .MAKE.EXPORTED even though $\ |
| | | 103 | it is not exported anymore. |
| | | 104 | .endif |
| | | 105 | |
| | | 106 | |
89 | all: | | 107 | all: |
90 | @:; | | | |