1 # $NetBSD: vardebug.mk,v 1.3 2020/08/08 14:28:46 rillig Exp $
3 # Demonstrates the debugging output for var.c.
8 VAR= overwritten # Var_Set
9 .undef VAR # Var_Delete (found)
10 .undef VAR # Var_Delete (not found)
12 # The variable with the empty name cannot be set at all.
13 ${:U}= empty name # Var_Set
14 ${:U}+= empty name # Var_Append
16 FROM_CMDLINE= overwritten # Var_Set (ignored)
22 .if ${VAR:M[2]} # VarMatch
24 .if ${VAR:N[2]} # VarNoMatch (no debug output)
27 .if ${VAR:S,2,two,} # VarGetPattern
30 .if ${VAR:Q} # VarQuote
33 .if ${VAR:tu:tl:Q} # ApplyModifiers
36 # ApplyModifiers, "Got ..."
37 .if ${:Uvalue:${:UM*e}:Mvalu[e]}
40 .undef ${:UVAR} # Var_Delete
42 # When ApplyModifiers results in an error, this appears in the debug log
43 # as "is error", without surrounding quotes.
44 .if ${:Uvariable:unknown}
47 # XXX: The error message is "Malformed conditional", which is wrong.
48 # The condition is syntactically fine, it just contains an undefined variable.
50 # There is a specialized error message for "Undefined variable", but as of
51 # 2020-08-08, that is not covered by any unit tests. It might even be