* src/read.c (record_target_var): Don't overwrite pre-existing export
flag unless we're changing it.
* tests/scripts/features/targetvars: Add a test.
/* Set up the variable to be *-specific. */
v->per_target = 1;
v->private_var = vmod->private_v;
- v->export = vmod->export_v ? v_export : v_default;
+ if (vmod->export_v)
+ v->export = v_export;
/* If it's not an override, check to see if there was a command-line
setting. If so, reset the value. */
run_make_test(undef, "foo.t bar.s", "qvar = qvar\nqvar =\n");
-
# TEST #8
# For PR/1378: Target-specific vars don't inherit correctly
!,
'', 'hello=moon');
+# SV 59230: Assignment of a global variable should not affect export of a
+# target specific variable.
+
+$ENV{hello} = "moon";
+run_make_test(q!
+all:; @echo hello=$$hello
+hello=sun
+dummy: hello?=world
+!,
+ '', 'hello=sun');
+
# TEST #19: Test define/endef variables as target-specific vars
# run_make_test('