| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $Id: varmisc.mk,v 1.19 2020/07/28 19:39:43 rillig Exp $ | | 1 | # $Id: varmisc.mk,v 1.20 2020/07/30 13:50:27 rillig Exp $ |
2 | # | | 2 | # |
3 | # Miscellaneous variable tests. | | 3 | # Miscellaneous variable tests. |
4 | | | 4 | |
5 | all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \ | | 5 | all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \ |
6 | strftime cmpv manok | | 6 | strftime cmpv manok |
7 | all: save-dollars | | 7 | all: save-dollars |
8 | all: export-appended | | 8 | all: export-appended |
9 | all: parse-dynamic | | 9 | all: parse-dynamic |
10 | all: varerror-unclosed | | 10 | all: varerror-unclosed |
11 | | | 11 | |
12 | unmatched_var_paren: | | 12 | unmatched_var_paren: |
13 | @echo ${foo::=foo-text} | | 13 | @echo ${foo::=foo-text} |
14 | | | 14 | |
| @@ -184,36 +184,41 @@ GL_TARGET:= ${.TARGET} | | | @@ -184,36 +184,41 @@ GL_TARGET:= ${.TARGET} |
184 | GL_MEMBER:= ${.MEMBER} | | 184 | GL_MEMBER:= ${.MEMBER} |
185 | GL_PREFIX:= ${.PREFIX} | | 185 | GL_PREFIX:= ${.PREFIX} |
186 | GL_ARCHIVE:= ${.ARCHIVE} | | 186 | GL_ARCHIVE:= ${.ARCHIVE} |
187 | GL_ALLSRC:= ${.ALLSRC} | | 187 | GL_ALLSRC:= ${.ALLSRC} |
188 | | | 188 | |
189 | parse-dynamic: | | 189 | parse-dynamic: |
190 | @echo $@: ${GS_TARGET} ${GS_MEMBER} ${GS_PREFIX} ${GS_ARCHIVE} ${GS_ALLSRC} | | 190 | @echo $@: ${GS_TARGET} ${GS_MEMBER} ${GS_PREFIX} ${GS_ARCHIVE} ${GS_ALLSRC} |
191 | @echo $@: ${GB_TARGET} ${GB_MEMBER} ${GB_PREFIX} ${GB_ARCHIVE} ${GB_ALLSRC} | | 191 | @echo $@: ${GB_TARGET} ${GB_MEMBER} ${GB_PREFIX} ${GB_ARCHIVE} ${GB_ALLSRC} |
192 | @echo $@: ${GL_TARGET} ${GL_MEMBER} ${GL_PREFIX} ${GL_ARCHIVE} ${GL_ALLSRC} | | 192 | @echo $@: ${GL_TARGET} ${GL_MEMBER} ${GL_PREFIX} ${GL_ARCHIVE} ${GL_ALLSRC} |
193 | | | 193 | |
194 | # Since 2020-07-28, make complains about unclosed variables. | | 194 | # Since 2020-07-28, make complains about unclosed variables. |
195 | # Before that, it had not complained about unclosed variables only when | | 195 | # Before that, it had not complained about unclosed variables only when |
196 | # parsing the modifiers, but not when parsing the variable name. | | 196 | # parsing the modifiers, but not when parsing the variable name. |
| | | 197 | |
| | | 198 | UNCLOSED_INDIR_1= ${UNCLOSED_ORIG |
| | | 199 | UNCLOSED_INDIR_2= ${UNCLOSED_INDIR_1} |
| | | 200 | |
197 | varerror-unclosed: | | 201 | varerror-unclosed: |
198 | @echo $@:begin | | 202 | @echo $@:begin |
199 | @echo $( | | 203 | @echo $( |
200 | @echo $(UNCLOSED | | 204 | @echo $(UNCLOSED |
201 | @echo ${UNCLOSED | | 205 | @echo ${UNCLOSED |
202 | @echo ${UNCLOSED:M${PATTERN | | 206 | @echo ${UNCLOSED:M${PATTERN |
203 | @echo ${UNCLOSED.${param | | 207 | @echo ${UNCLOSED.${param |
204 | @echo $ | | 208 | @echo $ |
205 | .for i in 1 2 3 | | 209 | .for i in 1 2 3 |
206 | @echo ${UNCLOSED.${i} | | 210 | @echo ${UNCLOSED.${i} |
207 | .endfor | | 211 | .endfor |
| | | 212 | @echo ${UNCLOSED_INDIR_2} |
208 | @echo $@:end | | 213 | @echo $@:end |
209 | | | 214 | |
210 | # As of 2020-07-28, .undef only undefines the first variable. | | 215 | # As of 2020-07-28, .undef only undefines the first variable. |
211 | # All further variable names are silently ignored. | | 216 | # All further variable names are silently ignored. |
212 | # See parse.c, string literal "undef". | | 217 | # See parse.c, string literal "undef". |
213 | 1= 1 | | 218 | 1= 1 |
214 | 2= 2 | | 219 | 2= 2 |
215 | 3= 3 | | 220 | 3= 3 |
216 | .undef 1 2 3 | | 221 | .undef 1 2 3 |
217 | .if ${1:U_}${2:U_}${3:U_} != _23 | | 222 | .if ${1:U_}${2:U_}${3:U_} != _23 |
218 | .warning $1$2$3 | | 223 | .warning $1$2$3 |
219 | .endif | | 224 | .endif |