head 1.10; access; symbols netbsd-10-2-RELEASE:1.4 netbsd-11-0-RELEASE:1.10 netbsd-11-0-RC7:1.10 netbsd-11-0-RC6:1.10 netbsd-11-0-RC5:1.10 netbsd-11-0-RC4:1.10 netbsd-11-0-RC3:1.10 netbsd-11-0-RC2:1.10 netbsd-11-0-RC1:1.10 perseant-exfatfs-base-20250801:1.10 netbsd-11:1.10.0.2 netbsd-11-base:1.10 netbsd-10-1-RELEASE:1.4 perseant-exfatfs-base-20240630:1.7 perseant-exfatfs:1.7.0.2 perseant-exfatfs-base:1.7 netbsd-10-0-RELEASE:1.4 netbsd-10-0-RC6:1.4 netbsd-10-0-RC5:1.4 netbsd-10-0-RC4:1.4 netbsd-10-0-RC3:1.4 netbsd-10-0-RC2:1.4 netbsd-10-0-RC1:1.4 netbsd-10:1.4.0.6 netbsd-10-base:1.4 cjep_sun2x-base1:1.4 cjep_sun2x:1.4.0.4 cjep_sun2x-base:1.4 cjep_staticlib_x-base1:1.4 cjep_staticlib_x:1.4.0.2 cjep_staticlib_x-base:1.4; locks; strict; comment @# @; 1.10 date 2025.01.14.21.23.17; author rillig; state Exp; branches; next 1.9; commitid 4sf0C5zaebtxWuFF; 1.9 date 2025.01.11.21.21.33; author rillig; state Exp; branches; next 1.8; commitid NtFvbDJHnW9G17FF; 1.8 date 2024.07.09.19.43.01; author rillig; state Exp; branches; next 1.7; commitid qrdgBafp1onZqchF; 1.7 date 2024.06.02.15.31.26; author rillig; state Exp; branches 1.7.2.1; next 1.6; commitid 5Mni16wWNMJogqcF; 1.6 date 2023.11.19.22.06.15; author rillig; state Exp; branches; next 1.5; commitid orhWVt8YK9haKgNE; 1.5 date 2023.02.13.21.01.46; author rillig; state Exp; branches; next 1.4; commitid YJMh9bhFrMJhlpdE; 1.4 date 2020.09.08.05.26.22; author rillig; state Exp; branches; next 1.3; commitid WmuROrlZM8FTGcnC; 1.3 date 2020.09.03.19.50.14; author rillig; state Exp; branches; next 1.2; commitid mGjny5Qcua4EFDmC; 1.2 date 2020.09.03.19.10.56; author rillig; state Exp; branches; next 1.1; commitid xobLkz6kbkyWrDmC; 1.1 date 2020.08.22.16.51.26; author rillig; state Exp; branches; next ; commitid ZqAkNrDqNrg645lC; 1.7.2.1 date 2025.08.02.05.58.32; author perseant; state Exp; branches; next ; commitid 23j6GFaDws3O875G; desc @@ 1.10 log @make: simplify parsing of dependency lines The evaluation modes that allow or deny undefined variables have the same effect in this case, as Var_Subst does not return an error marker. @ text @Var_Parse: ${UNDEF1} (eval) Global: .ALLTARGETS = all Global: .ALLTARGETS = all ${DEF2} Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 Global: INDIRECT_1 = 2-$${INDIRECT_2}-2 Global: INDIRECT_2 = 3-$${INDIRECT_3}-3 Global: INDIRECT_3 = indirect Global: UNDEF1 = undef1 Global: DEF2 = def2 Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) Var_Parse: ${:U\$)}: (eval) Evaluating modifier ${:U...} on value "" (eval, undefined) Result of ${:U\$)} is "$)" (eval, defined) Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) undef1 Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) undef1 def2 Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) undef1 def2 a-def2-b Var_Parse: $INDIRECT_2-2-1 $): (parse) Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) undef1 def2 a-def2-b 1-2-$INDIRECT_2-2-1 Var_Parse: $): (parse) Global: .ALLTARGETS = all ${DEF2} a-${DEF2}-b ${UNDEF3} 1-${INDIRECT_1}-1 $$) undef1 def2 a-def2-b 1-2-$INDIRECT_2-2-1 $) Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 make: Malformed expression at "$)" def2 a-def2-b 1-2-NDIRECT_2-2-1 ) exit status 2 @ 1.9 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 @d1 1 a1 1 Var_Parse: ${UNDEF1} (eval-defined) d13 1 a13 1 Var_Parse: ${:U\$)}: (eval-defined) @ 1.8 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 @d14 2 a15 2 Evaluating modifier ${:U...} on value "" (eval-defined, undefined) Result of ${:U\$)} is "$)" (eval-defined, defined) @ 1.7 log @make: sync VarEvalMode constant names with their debug log names @ text @d30 1 a30 1 exit status 0 @ 1.7.2.1 log @Sync with HEAD @ text @d1 1 a1 1 Var_Parse: ${UNDEF1} (eval) d13 3 a15 3 Var_Parse: ${:U\$)}: (eval) Evaluating modifier ${:U...} on value "" (eval, undefined) Result of ${:U\$)} is "$)" (eval, defined) d30 1 a30 1 exit status 2 @ 1.6 log @make: replace 'variable expression' with 'expression' in diagnostics @ text @d19 1 a19 1 Var_Parse: $INDIRECT_2-2-1 $): (parse-only) d21 1 a21 1 Var_Parse: $): (parse-only) @ 1.5 log @tests/make: update test for evaluating undefined variables @ text @d25 1 a25 1 make: Malformed variable expression at "$)" @ 1.4 log @make(1): fix off-by-one error in SuffExpandChildren In suff.c r1.144 from yesterday, in the line "cp += nested_p - cp", I accidentally removed the "- 1". Since these "- 1" lines lead to slow execution, each branch now increments the pointer separately by the actually needed amount. Fixing this bug posed way more new questions than it answered, and it revealed an inconsistency in the parser about how characters are to be escaped, and missing details in the documentation of Var_Parse, as well as a parse error that unexpectedly doesn't stop make from continuing. @ text @d1 24 @ 1.3 log @make(1): add test for expansion of indirect variables in dependencies @ text @d1 1 d5 1 @ 1.2 log @make: extend test for unresolved variables in dependencies This is to ensure that the upcoming refactoring of Var_Parse in SuffExpandChildren does not break anything. @ text @d3 1 @ 1.1 log @make(1): add test for deferred variable expansion in dependencies @ text @d2 1 @