head 1.10; access; symbols netbsd-11-0-RC4:1.9 netbsd-11-0-RC3:1.9 netbsd-11-0-RC2:1.9 netbsd-11-0-RC1:1.9 perseant-exfatfs-base-20250801:1.9 netbsd-11:1.9.0.4 netbsd-11-base:1.9 netbsd-10-1-RELEASE:1.4 perseant-exfatfs-base-20240630:1.9 perseant-exfatfs:1.9.0.2 perseant-exfatfs-base:1.9 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.2 netbsd-10-base:1.4; locks; strict; comment @# @; 1.10 date 2026.01.05.22.44.14; author rillig; state Exp; branches; next 1.9; commitid nizffgI5gEw7XfpG; 1.9 date 2024.03.05.23.07.58; author rillig; state Exp; branches; next 1.8; commitid 1jL7YoJVwFzQD11F; 1.8 date 2024.03.01.20.15.59; author sjg; state Exp; branches; next 1.7; commitid J7fnm0cafqmCPu0F; 1.7 date 2023.12.20.09.03.09; author rillig; state Exp; branches; next 1.6; commitid saXdfuWtebjipbRE; 1.6 date 2023.04.29.10.16.24; author rillig; state Exp; branches; next 1.5; commitid 69uHhQgur2tBnZmE; 1.5 date 2023.04.28.13.09.48; author rillig; state Exp; branches; next 1.4; commitid dNBSJ8kmwUVWmSmE; 1.4 date 2022.03.26.14.34.07; author rillig; state Exp; branches; next 1.3; commitid bA2GMsf46REOCJxD; 1.3 date 2022.01.29.00.52.53; author rillig; state Exp; branches; next 1.2; commitid 6wm5SwNxYOMWQsqD; 1.2 date 2022.01.27.06.56.27; author sjg; state Exp; branches; next 1.1; commitid GYgTXoGuWEkUXeqD; 1.1 date 2022.01.23.16.25.54; author rillig; state Exp; branches; next ; commitid dbnZ1mvRWB9WeMpD; desc @@ 1.10 log @tests/make: demonstrate differing ${.PREFIX} in jobs and compat mode Reported in PR 59073 by David A. Holland. @ text @Global: .ALLTARGETS = all target-rule.ext dir/subdir/target-rule.ext target-rule.ir-gen-from dir/subdir/target-rule-dir.ir-gen-from inference-rule.ir-to dir/subdir/inference-rule.ir-to inference-rule.ir-from dir/subdir/inference-rule.ir-from inference-rule-chain.ir-to dir/subdir/inference-rule-chain.ir-to inference-rule-chain.ir-gen-from dir/subdir/inference-rule-chain.ir-gen-from one Global: .ALLTARGETS = all target-rule.ext dir/subdir/target-rule.ext target-rule.ir-gen-from dir/subdir/target-rule-dir.ir-gen-from inference-rule.ir-to dir/subdir/inference-rule.ir-to inference-rule.ir-from dir/subdir/inference-rule.ir-from inference-rule-chain.ir-to dir/subdir/inference-rule-chain.ir-to inference-rule-chain.ir-gen-from dir/subdir/inference-rule-chain.ir-gen-from one two Var_Parse: ${.MAKE.TARGET_LOCAL_VARIABLES} (eval) one: ignoring ' = three' as the variable name '' expands to empty two: ignoring ' = three' as the variable name '' expands to empty Global: one two = # (empty) Global: one two = three Global: .MAKEFLAGS = -r -k -d v -d Global: .MAKEFLAGS = -r -k -d v -d 0 target-rule.ext: @@ = target-rule.ext: % = target-rule.ext: ? = <> target-rule.ext: < = target-rule.ext: * = dir/subdir/target-rule.ext: @@ = dir/subdir/target-rule.ext: % = dir/subdir/target-rule.ext: ? = <> dir/subdir/target-rule.ext: < = dir/subdir/target-rule.ext: * = target-rule.ir-gen-from: @@ = target-rule.ir-gen-from: % = target-rule.ir-gen-from: ? = <> target-rule.ir-gen-from: < = target-rule.ir-gen-from: * = dir/subdir/target-rule-dir.ir-gen-from: @@ = dir/subdir/target-rule-dir.ir-gen-from: % = dir/subdir/target-rule-dir.ir-gen-from: ? = <> dir/subdir/target-rule-dir.ir-gen-from: < = dir/subdir/target-rule-dir.ir-gen-from: * = inference-rule.ir-to: @@ = inference-rule.ir-to: % = inference-rule.ir-to: ? = inference-rule.ir-to: < = inference-rule.ir-to: * = dir/subdir/inference-rule.ir-to: @@ = dir/subdir/inference-rule.ir-to: % = dir/subdir/inference-rule.ir-to: ? = dir/subdir/inference-rule.ir-to: < = dir/subdir/inference-rule.ir-to: * = inference-rule-chain.ir-from: @@ = inference-rule-chain.ir-from: % = inference-rule-chain.ir-from: ? = inference-rule-chain.ir-from: < = inference-rule-chain.ir-from: * = inference-rule-chain.ir-to: @@ = inference-rule-chain.ir-to: % = inference-rule-chain.ir-to: ? = inference-rule-chain.ir-to: < = inference-rule-chain.ir-to: * = dir/subdir/inference-rule-chain.ir-from: @@ = dir/subdir/inference-rule-chain.ir-from: % = dir/subdir/inference-rule-chain.ir-from: ? = dir/subdir/inference-rule-chain.ir-from: < = dir/subdir/inference-rule-chain.ir-from: * = dir/subdir/inference-rule-chain.ir-to: @@ = dir/subdir/inference-rule-chain.ir-to: % = dir/subdir/inference-rule-chain.ir-to: ? = dir/subdir/inference-rule-chain.ir-to: < = dir/subdir/inference-rule-chain.ir-to: * = : Making var-scope-local.c out of nothing. : Making var-scope-local.o from var-scope-local.c. : Making basename "var-scope-local.o" in "." from "var-scope-local.c" in ".". Making var-scope-local-assign.o with make 'local' and env 'local'. Making var-scope-local-append.o with make 'local to var-scope-local-append.o' and env 'local to var-scope-local-append.o'. Making var-scope-local-append-global.o with make 'global+local' and env 'global+local'. Making var-scope-local-default.o with make 'global' and env 'global'. Making var-scope-local-subst.o with make 'global+local' and env 'global+local'. Making var-scope-local-shell.o with make 'output' and env 'output'. Making .USE var-scope-local-use.o with make 'global' and env 'global'. begin pr-59073 compat $@@ is pr-59073/file.o59703 $< is pr-59073/file.c59703 $* is pr-59073/file end pr-59073 compat begin pr-59073 parallel $@@ is pr-59073/file.o59703 $< is pr-59073/file.c59703 $* is file end pr-59073 parallel : all overwritten exit status 0 @ 1.9 log @tests/make: clean up test for local scope variables Use the same style of quotes for both kinds of variables. To make the variable values more easily comparable, write them to a single line. Add the output to the 'expect' lines. @ text @d70 10 @ 1.8 log @make: update var-scope-local test Show what VAR value is in environment of target script. @ text @d63 7 a69 14 : Making var-scope-local-assign.o with VAR="local". var-scope-local-assign.o env has VAR='local' : Making var-scope-local-append.o with VAR="local to var-scope-local-append.o". var-scope-local-append.o env has VAR='local to var-scope-local-append.o' : Making var-scope-local-append-global.o with VAR="global+local". var-scope-local-append-global.o env has VAR='global+local' : Making var-scope-local-default.o with VAR="global". var-scope-local-default.o env has VAR='global' : Making var-scope-local-subst.o with VAR="global+local". var-scope-local-subst.o env has VAR='global+local' : Making var-scope-local-shell.o with VAR="output". var-scope-local-shell.o env has VAR='output' : var-scope-local-use.o uses .USE VAR="global" var-scope-local-use.o env has VAR='global' @ 1.7 log @make: use consistent debug messages style when ignoring variables When a variable is not modified or not deleted, clearly say so and state the reason. Use the same style of debug messages everywhere, putting the word 'ignoring' at the front. Previously, that word sticked out to the right, but only in some cases. @ text @d64 1 d66 1 d68 1 d70 1 d72 1 d74 1 d76 1 @ 1.6 log @tests/make: extend test for target-local variables @ text @d4 2 a5 2 Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored Var_SetExpand: variable name "" expands to empty string, with value "three" - ignored @ 1.5 log @tests/make: add tests for target-local variables While here, move a test from var-scope-local.mk to parse.mk since that test is not related to variables. @ text @d1 2 a2 2 Global: .ALLTARGETS = all target-rule.ext dir/subdir/target-rule.ext inference-rule.ir-to dir/subdir/inference-rule.ir-to inference-rule.ir-from dir/subdir/inference-rule.ir-from inference-rule-chain.ir-to dir/subdir/inference-rule-chain.ir-to inference-rule-chain.ir-gen-from dir/subdir/inference-rule-chain.ir-gen-from one Global: .ALLTARGETS = all target-rule.ext dir/subdir/target-rule.ext inference-rule.ir-to dir/subdir/inference-rule.ir-to inference-rule.ir-from dir/subdir/inference-rule.ir-from inference-rule-chain.ir-to dir/subdir/inference-rule-chain.ir-to inference-rule-chain.ir-gen-from dir/subdir/inference-rule-chain.ir-gen-from one two d20 10 @ 1.4 log @make: avoid trailing whitespace in debug log for variables Since trailing whitespace is invisible, describe the variable value in words to make it visible. @ text @d1 2 a2 2 Global: .ALLTARGETS = one Global: .ALLTARGETS = one two d10 40 @ 1.3 log @tests/make: extend and isolate tests for target-local variables Reusing the target var-scope-local.o for several tests made the test more difficult to understand than necessary. The test names '2' and '3' didn't convey any meaning. Instead, add more test targets that are named after what they test. Add tests for each of the 5 variable assignment operators, to demonstrate an inconsistency between '+=' and '?='. Add tests for the built-in target-local variables as well and explain the general concepts, in particular the exact point where target-local expressions are expanded. The lines in the expected output file are not generated in the same order as they appear in the makefile, so allow the 'expect' lines in non-linear order, in check-expect.lua. @ text @d6 1 a6 1 Global: one two = @ 1.2 log @Unit test for local variables @ text @d1 9 d12 9 a20 7 : Making basename "var-scope-local.o" in "." from "var-scope-local.c" in "." VAR="local". : Making var-scope-local2.c out of nothing. : Making var-scope-local2.o from var-scope-local2.c. : Making basename "var-scope-local2.o" in "." from "var-scope-local2.c" in "." VAR="local to var-scope-local2.o". : Making var-scope-local3.c out of nothing. : var-scope-local3.o uses .USE VAR="global+local" : all overwritten VAR="global" @ 1.1 log @tests/make: rename var-class to var-scope There is no such concept as a "variable class" in make, these tests focus on the variable scope instead. @ text @d3 7 a9 2 : Making basename "var-scope-local.o" in "." from "var-scope-local.c" in ".". : all overwritten @