+2010-11-28 Paul Smith <psmith@gnu.org>
+
+ * read.c (record_target_var): Don't reset v if it's the same as
+ the global version. Fixes Savannah bug #31743.
+
2010-11-06 Paul Smith <psmith@gnu.org>
* variable.c (print_auto_variable): Print auto variables; ignore others.
@quotation
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2 or
+under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below. A copy of the
Variable values of the top-level @code{make} can be passed to the
sub-@code{make} through the environment by explicit request. These
-variables are defined in the sub-@code{make} as defaults, but do not
-override what is specified in the makefile used by the sub-@code{make}
-makefile unless you use the @samp{-e} switch (@pxref{Options Summary,
-,Summary of Options}).@refill
+variables are defined in the sub-@code{make} as defaults, but they do
+not override variables defined in the makefile used by
+the sub-@code{make} unless you use the @samp{-e} switch (@pxref{Options
+Summary, ,Summary of Options}).@refill
To pass down, or @dfn{export}, a variable, @code{make} adds the
variable and its value to the environment for running each line of the
int len = strlen(v->name);
gv = lookup_variable (v->name, len);
- if (gv && (gv->origin == o_env_override || gv->origin == o_command))
+ if (gv && v != gv
+ && (gv->origin == o_env_override || gv->origin == o_command))
{
if (v->value != 0)
free (v->value);
run_make_test(undef, 'FOO=C', "C f1\n");
+# TEST #19: Conditional variables with command-line settings
+
+run_make_test('
+a: FOO ?= f1
+a: ; @echo "$(FOO)"
+',
+ '', "f1\n");
+
+run_make_test(undef, 'FOO=C', "C\n");
+
# TEST #20: Check for continuation after semicolons
run_make_test(q!