1 # $NetBSD: varmod-l-name-to-value.mk,v 1.7 2020/10/24 08:46:08 rillig Exp $
3 # Tests for the :L modifier, which returns the variable name as the new value.
5 # The empty variable name leads to an empty string.
10 # The variable name is converted into an expression with the variable name
11 # "VARNAME" and the value "VARNAME".
12 .if ${VARNAME:L} != "VARNAME"
16 # The value of the expression can be modified afterwards.
17 .if ${VARNAME:L:S,VAR,,} != "NAME"
21 # The name of the expression is still the same as before. Using the :L
22 # modifier, it can be restored.
24 # Hmmm, this can be used as a double storage or a backup mechanism.
25 # Probably unintended, but maybe useful.
26 .if ${VARNAME:L:S,VAR,,:L} != "VARNAME"
30 # Between 2020-09-22 (var.c 1.527) and 2020-09-30 (var.c 1.553), there was
31 # a bug in the evaluation of variable expressions. Indirect modifiers like
32 # the below :L did not update the definedness of the enclosing expression.
33 # This resulted in a wrong "Malformed conditional".
34 .if ${value:${:UL}} == ""
37 # As of 2020-10-02, the :L modifier does not ensure that it is followed by
38 # a delimiter, that is, a ':' or endc. Neither does the :P modifier.
39 .if ${value:LLLLLLPL} != "value"