head 1.36; access; symbols perseant-exfatfs-base-20261102:1.36 netbsd-11-1-RELEASE:1.35 netbsd-10-2-RELEASE:1.17 netbsd-11-0-RELEASE:1.35 netbsd-11-0-RC7:1.35 netbsd-11-0-RC6:1.35 netbsd-11-0-RC5:1.35 netbsd-11-0-RC4:1.35 netbsd-11-0-RC3:1.35 netbsd-11-0-RC2:1.35 netbsd-11-0-RC1:1.35 perseant-exfatfs-base-20250801:1.35 netbsd-11:1.35.0.2 netbsd-11-base:1.35 netbsd-10-1-RELEASE:1.17 perseant-exfatfs-base-20240630:1.23 perseant-exfatfs:1.20.0.2 perseant-exfatfs-base:1.20 netbsd-10-0-RELEASE:1.17 netbsd-10-0-RC6:1.17 netbsd-10-0-RC5:1.17 netbsd-10-0-RC4:1.17 netbsd-10-0-RC3:1.17 netbsd-10-0-RC2:1.17 netbsd-10-0-RC1:1.17 netbsd-10:1.17.0.2 netbsd-10-base:1.17 cjep_sun2x-base1:1.16 cjep_sun2x:1.16.0.4 cjep_sun2x-base:1.16 cjep_staticlib_x-base1:1.16 cjep_staticlib_x:1.16.0.2 cjep_staticlib_x-base:1.16; locks; strict; comment @# @; 1.36 date 2026.02.01.16.42.35; author rillig; state Exp; branches; next 1.35; commitid QDTzAMUxdyOj5HsG; 1.35 date 2025.06.16.18.20.00; author rillig; state Exp; branches; next 1.34; commitid SL73kxnHvsOH09ZF; 1.34 date 2025.03.30.01.09.41; author rillig; state Exp; branches; next 1.33; commitid LoyOQ45u1cW7O1PF; 1.33 date 2025.03.29.19.08.52; author rillig; state Exp; branches; next 1.32; commitid y95n9TsA04p0PZOF; 1.32 date 2025.03.29.11.51.54; author rillig; state Exp; branches; next 1.31; commitid mZcBoX71W1xSoXOF; 1.31 date 2025.03.29.10.39.48; author rillig; state Exp; branches; next 1.30; commitid 22Yp9aLGm4mSZWOF; 1.30 date 2025.01.11.21.21.34; author rillig; state Exp; branches; next 1.29; commitid NtFvbDJHnW9G17FF; 1.29 date 2024.08.29.20.20.36; author rillig; state Exp; branches; next 1.28; commitid EaMgk7FrF8mB1LnF; 1.28 date 2024.07.20.11.05.12; author rillig; state Exp; branches; next 1.27; commitid Bey1UaNE0WVGeziF; 1.27 date 2024.07.09.19.43.01; author rillig; state Exp; branches; next 1.26; commitid qrdgBafp1onZqchF; 1.26 date 2024.07.05.19.47.22; author rillig; state Exp; branches; next 1.25; commitid ey8c5i7vJGMuCGgF; 1.25 date 2024.07.04.18.53.37; author rillig; state Exp; branches; next 1.24; commitid 7qUZd0dIKoMjlygF; 1.24 date 2024.07.04.17.47.54; author rillig; state Exp; branches; next 1.23; commitid mjDGVMgldk7QYxgF; 1.23 date 2024.06.30.15.21.24; author rillig; state Exp; branches; next 1.22; commitid EKaDoruUWtqah1gF; 1.22 date 2024.06.30.11.44.14; author rillig; state Exp; branches; next 1.21; commitid Jqsc8BMZ1ZvK60gF; 1.21 date 2024.06.30.11.37.21; author rillig; state Exp; branches; next 1.20; commitid yW5k27FNGJ0c30gF; 1.20 date 2024.04.20.10.18.55; author rillig; state Exp; branches 1.20.2.1; next 1.19; commitid 2fCjOO5HMlf2VR6F; 1.19 date 2024.01.07.11.42.22; author rillig; state Exp; branches; next 1.18; commitid QjOxY3U3MmgXIvTE; 1.18 date 2023.12.29.15.47.03; author rillig; state Exp; branches; next 1.17; commitid BXbkoa5ruJrMmnSE; 1.17 date 2021.11.30.20.48.01; author rillig; state Exp; branches; next 1.16; commitid 3HKzcfQpjEKEpRiD; 1.16 date 2021.04.06.01.38.39; author rillig; state Exp; branches; next 1.15; commitid F27I5gAukC2oIaOC; 1.15 date 2021.04.05.13.35.41; author rillig; state Exp; branches; next 1.14; commitid y78jOaWq6kEPH6OC; 1.14 date 2021.04.05.13.27.30; author rillig; state Exp; branches; next 1.13; commitid EFEmU5rV0hSkF6OC; 1.13 date 2021.04.05.13.14.55; author rillig; state Exp; branches; next 1.12; commitid zpXL8mB8Gp4XA6OC; 1.12 date 2021.04.03.22.02.59; author rillig; state Exp; branches; next 1.11; commitid kY1ba3OEWIFRzTNC; 1.11 date 2021.03.15.18.56.38; author rillig; state Exp; branches; next 1.10; commitid h5vYUBGCunvH8rLC; 1.10 date 2021.03.15.18.46.05; author rillig; state Exp; branches; next 1.9; commitid jKy0jSm4FOwX6rLC; 1.9 date 2021.02.23.16.07.14; author rillig; state Exp; branches; next 1.8; commitid hJeSMmQyXyb4SQIC; 1.8 date 2021.02.23.15.19.41; author rillig; state Exp; branches; next 1.7; commitid wGJlKlrQTIQeBQIC; 1.7 date 2021.02.23.00.04.48; author rillig; state Exp; branches; next 1.6; commitid a6mEYHxXTzJ9yLIC; 1.6 date 2020.10.18.21.36.22; author rillig; state Exp; branches; next 1.5; commitid DsMLeUq21UUmOqsC; 1.5 date 2020.08.25.21.16.53; author rillig; state Exp; branches; next 1.4; commitid BeBCh5BAFqF6rulC; 1.4 date 2020.08.25.21.07.39; author rillig; state Exp; branches; next 1.3; commitid Zmr79cQSQ4a8oulC; 1.3 date 2020.08.25.20.49.40; author rillig; state Exp; branches; next 1.2; commitid ISwj05Mbbkd1iulC; 1.2 date 2020.08.16.12.48.55; author rillig; state Exp; branches; next 1.1; commitid V0FRUH05ozBXUhkC; 1.1 date 2020.08.16.12.07.51; author rillig; state Exp; branches; next ; commitid coEgPk3hgfeYGhkC; 1.20.2.1 date 2024.07.01.01.01.15; author perseant; state Exp; branches; next 1.20.2.2; commitid NkoYLLCQWWw9v4gF; 1.20.2.2 date 2025.08.02.05.58.38; author perseant; state Exp; branches; next 1.20.2.3; commitid 23j6GFaDws3O875G; 1.20.2.3 date 2026.11.04.23.28.39; author perseant; state Exp; branches; next ; commitid 3QTNojfCEH9lUb2H; desc @@ 1.36 log @make: in stack traces, add location information for targets @ text @Global: param = twice Global: VARNAME = VAR.$${param} Var_Parse: ${VARNAME} (eval) Global: VAR.${param} = initial-value Var_Parse: ${${VARNAME}::=assigned-value} (eval-defined-loud) Var_Parse: ${VARNAME}::=assigned-value} (eval) Evaluating modifier ${VAR.${param}::...} on value "initial-value" Modifier part: "assigned-value" Global: VAR.${param} = assigned-value Result of ${VAR.${param}::=assigned-value} is "" Var_Parse: ${${VARNAME}} != "assigned-value" (eval-defined-loud) Var_Parse: ${VARNAME}} != "assigned-value" (eval) Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 Var_Parse: ${CMD_CMD_VAR::=new-value} || ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) Evaluating modifier ${CMD_CMD_VAR::...} on value "cmd-value" Modifier part: "new-value" Command: CMD_CMD_VAR = new-value Global: .MAKEOVERRIDES = FIRST LAST LAST LAST APPENDED RAN RAN RAN IT1 THEN1 IE2 ELSE2 CMD_CMD_VAR CMD_CMD_VAR Result of ${CMD_CMD_VAR::=new-value} is "" Var_Parse: ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) Evaluating modifier ${CMD_GLOBAL_VAR::...} on value "global-value" Modifier part: "new-value" Global: CMD_GLOBAL_VAR = new-value Result of ${CMD_GLOBAL_VAR::=new-value} is "" Var_Parse: ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) Evaluating modifier ${CMD_ENV_VAR::...} on value "env-value" Modifier part: "new-value" Global: CMD_ENV_VAR = new-value Result of ${CMD_ENV_VAR::=new-value} is "" Var_Parse: ${CMD_NEW_VAR::=new-value}" (eval) Evaluating modifier ${CMD_NEW_VAR::...} on value "" (eval, undefined) Modifier part: "new-value" Global: ignoring delete 'CMD_NEW_VAR' as it is not found Command: CMD_NEW_VAR = new-value Global: .MAKEOVERRIDES = FIRST LAST LAST LAST APPENDED RAN RAN RAN IT1 THEN1 IE2 ELSE2 CMD_CMD_VAR CMD_CMD_VAR CMD_NEW_VAR Result of ${CMD_NEW_VAR::=new-value} is "" (eval, undefined) Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0 make: Invalid attempt to assign "value" to variable "" via modifier "::=" while evaluating "${::=value}" with value "" in command "@@echo $@@: ${::=value}" in target "mod-assign-empty-1" from varmod-assign.mk:78 make: Invalid attempt to assign "overwritten" to variable "" via modifier "::=" while evaluating "${:Uvalue::=overwritten}" with value "value" in command "@@echo $@@: ${:Uvalue::=overwritten}" in target "mod-assign-empty-2" from varmod-assign.mk:84 make: Invalid attempt to assign "appended" to variable "" via modifier "::+=" while evaluating "${:Uvalue::+=appended}" with value "value" in command "@@echo $@@: ${:Uvalue::+=appended}" in target "mod-assign-empty-3" from varmod-assign.mk:90 mod-assign-empty-4: VAR=overwritten make: Unknown modifier "::x" while evaluating variable "ASSIGN" with value "" in command "@@echo ${ASSIGN::x}" in target "mod-assign-parse-1" from varmod-assign.mk:103 sysv:y make: Unfinished modifier after "value # missing closing brace", expecting "}" while evaluating variable "ASSIGN" with value "" in command "@@echo ${ASSIGN::=value # missing closing brace" in target "mod-assign-parse-3" from varmod-assign.mk:112 ok=word make: warning: Command " echo word; (exit 13) " exited with status 13 while evaluating variable "SH_ERR" with value "previous" in command "@@${SH_ERR::!= echo word; (exit 13) } echo err=${SH_ERR}" in target "mod-assign-shell-error" from varmod-assign.mk:120 err=previous Command: TARGET_CMD_VAR = cmd-value Global: TARGET_GLOBAL_VAR = global-value target: TARGET_TARGET_VAR = target-value target: TARGET_TARGET_VAR = new-value Global: TARGET_GLOBAL_VAR = new-value Global: TARGET_ENV_VAR = new-value target: TARGET_NEW_VAR = new-value exit status 2 @ 1.35 log @make: in a warning without location information, print the stack trace Without further context, a warning like the following is hard to track back: > nbmake[4]: warning: Invalid character " " in variable name > "if ,"LSAN_OPTIONS="" @ text @d43 1 a43 1 in target "mod-assign-empty-1" d47 1 a47 1 in target "mod-assign-empty-2" d51 1 a51 1 in target "mod-assign-empty-3" d56 1 a56 1 in target "mod-assign-parse-1" d61 1 a61 1 in target "mod-assign-parse-3" d66 1 a66 1 in target "mod-assign-shell-error" @ 1.34 log @make: add details to error message for the "::=" modifier The previous error message about a bad modifier ":" was not helpful, as the strcspn call stopped immediately due to the modifier starting with the separater character ":". The previous error message also didn't reveal that the "parse error" was due to the expression name being empty. @ text @d64 3 @ 1.33 log @make: add ":" to error message about unknown modifier In the manual page, the modifiers are listed with a preceding ":", so use the same pattern in the error message. This removes an inconsistency between the error messages "Unknown modifier" and "Bad modifier". @ text @d40 1 a40 1 make: Bad modifier ":" d44 1 a44 1 make: Bad modifier ":" d48 5 a52 1 mod-assign-empty-3: VAR=overwritten @ 1.32 log @make: add more details to error message about unfinished modifier These details allow to quickly see the place where the syntax error is, based on the surrounding lines from the stack trace. @ text @d49 1 a49 1 make: Unknown modifier ":x" @ 1.31 log @make: in stack traces from target commands, add the command level A target can contain several commands, and these commands are likely to contain the same expressions. To distinguish them, add one more line to the stack trace, to narrow down the source of the error. @ text @d54 1 a54 1 make: Unfinished modifier ('}' missing) @ 1.30 log @make: replace "Malformed conditional" with "Variable is undefined" Evaluating a conditional such as ".if ${UNDEF}" produced a "Malformed conditional" error, even though the form of the conditional was correct, it was the content of the variable that was wrong. Replace this message with the more accurate "Variable is undefined", revealing which of the possibly many variables is actually undefined. @ text @d42 1 d46 1 d51 1 d56 1 @ 1.29 log @make: reduce line length in error messages The error messages for deeply nested parse errors were hard to decipher, due to the large amount of text. Split these messages into individual lines, just as in the backtrace for .include files and .for loops. This unified backtrace makes the output more uniform. @ text @d5 2 a6 2 Var_Parse: ${${VARNAME}::=assigned-value} (eval-defined) Var_Parse: ${VARNAME}::=assigned-value} (eval-defined) d11 2 a12 2 Var_Parse: ${${VARNAME}} != "assigned-value" (eval-defined) Var_Parse: ${VARNAME}} != "assigned-value" (eval-defined) d15 1 a15 1 Var_Parse: ${CMD_CMD_VAR::=new-value} || ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined) d21 1 a21 1 Var_Parse: ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined) d26 1 a26 1 Var_Parse: ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined) @ 1.28 log @make: don't run erroneous commands in compat mode When there is a parse or evaluation error in an expression that becomes part of the command, don't run that command, as the result of the failed evaluation typically contains garbage characters. Skip the remaining commands from that target as well, as they may depend on the erroneous command. @ text @d40 6 a45 2 make: in target "mod-assign-empty-1": while evaluating "${::=value}" with value "": Bad modifier ":" make: in target "mod-assign-empty-2": while evaluating "${:Uvalue::=overwritten}" with value "value": Bad modifier ":" d47 3 a49 1 make: in target "mod-assign-parse-1": while evaluating variable "ASSIGN" with value "": Unknown modifier ":x" d51 3 a53 1 make: in target "mod-assign-parse-3": while evaluating variable "ASSIGN" with value "": Unfinished modifier ('}' missing) d55 1 a55 1 make: warning: in target "mod-assign-shell-error": while evaluating variable "SH_ERR" with value "previous": Command " echo word; (exit 13) " exited with status 13 @ 1.27 log @make: error out on parse/evaluation errors in shell commands The expression ${VAR:X} has an unknown modifier ':X'. Previously, this expression errored out when the expression was evaluated at parse time, but not when the expression was evaluated when generating the commands to bring a target up to date. The errors were previously reported, they didn't affect the exit status, though. Now, errors in expressions are handled in the same way, regardless of the time at which they are evaluated. @ text @d40 4 a43 7 make: in target "mod-assign-empty": while evaluating "${::=value}" with value "": Bad modifier ":" mod-assign-empty: value} make: in target "mod-assign-empty": while evaluating "${:Uvalue::=overwritten}" with value "value": Bad modifier ":" mod-assign-empty: overwritten} mod-assign-empty: VAR=overwritten make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unknown modifier ":x" d45 1 a45 2 make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unfinished modifier ('}' missing) @ 1.26 log @make: in error messages for anonymous variables, log the value @ text @d60 1 a60 1 exit status 0 @ 1.25 log @make: error out on the "Bad modifier" error message Previously, the "Bad modifier" error message did not affect make's exit status. As a side effect, this kind of error now gets more context information. @ text @d40 1 a40 1 make: in target "mod-assign-empty": while evaluating "${::=value}": Bad modifier ":" d42 1 a42 1 make: in target "mod-assign-empty": while evaluating "${:Uvalue::=overwritten}": Bad modifier ":" @ 1.24 log @make: add more context information to error messages In case of a parse error or evaluation error, print the variable value in addition to the variable name, to see the effects of previous expression modifiers. In nested make calls, print the current directory at the bottom of a stack trace, as that information is otherwise hard to get in a parallel build spanning multiple directories. @ text @d40 1 a40 1 make: Bad modifier ":" for variable "" d42 1 a42 1 make: Bad modifier ":" for variable "" @ 1.23 log @make: error out on some more syntax errors Previously, these errors only produced a message on stderr. They only affected make's exit status when they were evaluated at parse time, but not when evaluating the commands for a specific target right before executing them. The affected syntax errors are: * invalid regular expressions in the ':C' modifier * out-of-range references to regex groups in the ':C' modifier * unfinished modifiers @ text @d45 1 a45 1 make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unknown modifier ":x" d48 1 a48 1 make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unfinished modifier ('}' missing) d51 1 a51 1 make: warning: in target "mod-assign-shell-error": while evaluating variable "SH_ERR": Command " echo word; (exit 13) " exited with status 13 @ 1.22 log @make: sync error handling between '!=' assignment and '::!=' modifier @ text @d48 1 a48 1 make: Unfinished modifier for "ASSIGN" ('}' missing) @ 1.21 log @make: add detailed exit status to message for failed sub-commands Several commands communicate via the exit status and not only distinguish between zero and non-zero, so make this information available to ease investigations. The command "false" is not guaranteed to exit with a consistent status, so use "(exit 13)" instead in the tests, to keep these tests portable across different operating systems. The exit status 127 is required for a shell that cannot find a command, so keep that one. @ text @d51 1 a51 1 make: Command " echo word; (exit 13) " exited with status 13 @ 1.20 log @make: provide more context information for parse/evaluate errors @ text @d51 1 a51 1 make: " echo word; false " returned non-zero status @ 1.20.2.1 log @Sync with HEAD. @ text @d48 1 a48 1 make: in target "mod-assign-parse": while evaluating variable "ASSIGN": Unfinished modifier ('}' missing) d51 1 a51 1 make: warning: in target "mod-assign-shell-error": while evaluating variable "SH_ERR": Command " echo word; (exit 13) " exited with status 13 @ 1.20.2.2 log @Sync with HEAD @ text @d5 2 a6 2 Var_Parse: ${${VARNAME}::=assigned-value} (eval-defined-loud) Var_Parse: ${VARNAME}::=assigned-value} (eval) d11 2 a12 2 Var_Parse: ${${VARNAME}} != "assigned-value" (eval-defined-loud) Var_Parse: ${VARNAME}} != "assigned-value" (eval) d15 1 a15 1 Var_Parse: ${CMD_CMD_VAR::=new-value} || ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) d21 1 a21 1 Var_Parse: ${CMD_GLOBAL_VAR::=new-value} || ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) d26 1 a26 1 Var_Parse: ${CMD_ENV_VAR::=new-value} || "${CMD_NEW_VAR::=new-value}" (eval-defined-loud) d40 7 a46 17 make: Invalid attempt to assign "value" to variable "" via modifier "::=" while evaluating "${::=value}" with value "" in command "@@echo $@@: ${::=value}" in target "mod-assign-empty-1" make: Invalid attempt to assign "overwritten" to variable "" via modifier "::=" while evaluating "${:Uvalue::=overwritten}" with value "value" in command "@@echo $@@: ${:Uvalue::=overwritten}" in target "mod-assign-empty-2" make: Invalid attempt to assign "appended" to variable "" via modifier "::+=" while evaluating "${:Uvalue::+=appended}" with value "value" in command "@@echo $@@: ${:Uvalue::+=appended}" in target "mod-assign-empty-3" mod-assign-empty-4: VAR=overwritten make: Unknown modifier "::x" while evaluating variable "ASSIGN" with value "" in command "@@echo ${ASSIGN::x}" in target "mod-assign-parse-1" d48 2 a49 4 make: Unfinished modifier after "value # missing closing brace", expecting "}" while evaluating variable "ASSIGN" with value "" in command "@@echo ${ASSIGN::=value # missing closing brace" in target "mod-assign-parse-3" d51 1 a51 4 make: warning: Command " echo word; (exit 13) " exited with status 13 while evaluating variable "SH_ERR" with value "previous" in command "@@${SH_ERR::!= echo word; (exit 13) } echo err=${SH_ERR}" in target "mod-assign-shell-error" d60 1 a60 1 exit status 2 @ 1.20.2.3 log @Sync with HEAD @ text @d43 1 a43 1 in target "mod-assign-empty-1" from varmod-assign.mk:78 d47 1 a47 1 in target "mod-assign-empty-2" from varmod-assign.mk:84 d51 1 a51 1 in target "mod-assign-empty-3" from varmod-assign.mk:90 d56 1 a56 1 in target "mod-assign-parse-1" from varmod-assign.mk:103 d61 1 a61 1 in target "mod-assign-parse-3" from varmod-assign.mk:112 d66 1 a66 1 in target "mod-assign-shell-error" from varmod-assign.mk:120 @ 1.19 log @tests/make: test the '::=' modifier in target scope @ text @d45 1 a45 1 make: Unknown modifier ":x" @ 1.18 log @tests/make: test the '::=' assignment modifier @ text @d53 7 @ 1.17 log @tests/make: convert tests for modifier '::=' to parse time This puts the expected result of the expressions closer to the expressions, making the tests self-contained. The error messages that used to produce trailing spaces have been fixed in var.c 1.853 from 2021-02-23. The error message now encloses the variable name in quotes. @ text @d15 25 @ 1.16 log @make: reduce verbosity of the -dv debug logging for standard cases The verbosity was already removed from LogBeforeApply, now it is consistent between LogBeforeApply and LogAfterApply. @ text @a14 12 mod-assign: first=1. mod-assign: last=3. mod-assign: appended=1 2 3. 1 2 3 mod-assign: ran:3. mod-assign: global: 1, 3, 1 2 3, 3. mod-assign-nested: then1t1 mod-assign-nested: else2e2 mod-assign-nested: then3t3 mod-assign-nested: else4e4 @ 1.15 log @make: in debug log, add space between scope and variable name Without this space, the debug log looked more like line noise, even though the only punctuation was a single innocent ':'. From a make user's perspective, the variable name is a word of its own and should not be visually glued to its namespace. @ text @d10 1 a10 1 Result of ${VAR.${param}::=assigned-value} is "" (eval-defined, regular) @ 1.14 log @make: omit unnecessary details from -dv debug log When an expression is based on a defined variable, it does not matter whether the evaluation mode is "eval" or "eval-defined", therefore omit these details to reduce confusion. @ text @d1 2 a2 2 Global:param = twice Global:VARNAME = VAR.$${param} d4 1 a4 1 Global:VAR.${param} = initial-value d9 1 a9 1 Global:VAR.${param} = assigned-value d13 2 a14 2 Global:.MAKEFLAGS = -r -k -d v -d Global:.MAKEFLAGS = -r -k -d v -d 0 @ 1.13 log @make: be more verbose in -dv debug logging The previous log output was too brief to be understandable. Give more hints by describing each part of the expression when evaluating a modifier. Distinguish between parse-only mode and eval mode since in parse-only mode most of the details are irrelevant. @ text @d7 1 a7 1 Evaluating modifier ${VAR.${param}::...} on value "initial-value" (eval-defined, regular) @ 1.12 log @make: remove VarFlags from debug logging Before the introduction of ExprDefined, VarFlags contained whether the expression was defined or not, which was useful to know since the final value of the expression depends on this information. The other VarFlags do not influence the evaluation, so there is no point logging them. @ text @d7 1 a7 1 Applying ${VAR.${param}::...} to "initial-value" (eval-defined, regular) @ 1.11 log @make: fix double varname expansion in the variable modifier '::=' This is an edge case that doesn't occur in practice since pretty much nobody dares to use variable names that contain an actual '$' in their name. This is not about the fairly common VAR.${param} (as written in the makefile), but instead about the variable whose name is literally 'VAR.${param}'. The test demonstrates that after the fix, the variable name is taken exactly as-is for the simple assignment modifier '::='. There are no such tests for the modifiers '::+=', '::!=' and '::?=', but that's ok. The code in ApplyModifier_Assign would look assymetrical and suspicious enough if one of these modifiers would expand its variable name and the others wouldn't. @ text @d7 1 a7 1 Applying ${VAR.${param}::...} to "initial-value" (eval-defined, none, regular) d10 1 a10 1 Result of ${VAR.${param}::=assigned-value} is "" (eval-defined, none, regular) @ 1.10 log @tests/make: demonstrate that the modifier '::=' expands the varname @ text @d9 1 a9 2 Var_Parse: ${param} (eval) Global:VAR.twice = assigned-value d11 2 a12 4 Var_Parse: $ for symmetry with the usual assignment operators. (eval) make: "varmod-assign.mk" line 139: FIXME: don't expand the variable name twice here, for symmetry with the usual assignment operators. Var_Parse: ${${VARNAME}} != "initial-value" (eval-defined) Var_Parse: ${VARNAME}} != "initial-value" (eval-defined) @ 1.9 log @make: improve error message for bad modifier in variable expression The improvement is especially noteable for variable expressions based on the empty variable, see moderrs.exp:103. @ text @d1 17 @ 1.8 log @make: improve error message for unknown modifier Back in 1995, the modifiers were all single-character, and it made sense to print only the first character. Nowadays, with ':S', ':@@var@@...@@', '::=' and several others, a little more context is useful to see where the exact error is. The actual modifier is still guessed, and the guess may be wrong as soon as backslashes get involved, but it is still better than before. @ text @d13 1 a13 1 make: Bad modifier `:' for d15 1 a15 1 make: Bad modifier `:' for @ 1.7 log @make: add quotes around variable name in an error message @ text @d18 1 a18 1 make: Unknown modifier ':' @ 1.6 log @make(1): explain existing tests for the ::= assignment modifiers @ text @d21 1 a21 1 make: Unfinished modifier for ASSIGN ('}' missing) @ 1.5 log @make(1): fix error message for ::!= modifier with shell error It's just too easy to confuse st->val and val. @ text @d14 1 a14 1 value} @ 1.4 log @make(1): add test for ::!= modifier with shell error @ text @d24 1 a24 1 make: "previous" returned non-zero status @ 1.3 log @make(1): move test for the ::= modifier to varmod-assign @ text @d23 3 @ 1.2 log @make(1): move tests for the :gmtime and ::= modifiers to separate files @ text @d13 10 @ 1.1 log @make(1): add dummies for fine-grained tests, one per single feature The test names have been derived from the current manual page. All these tests are dummies right now, and the code from the existing tests will be moved into the new tests step by step. This is done to prevent modmisc, escape, varmod-edge and varmisc from growing without any bounds, and to reduce the side-effects of one test to the others. @ text @d1 12 @