diff options
author | Paul Smith <psmith@gnu.org> | 2010-11-30 14:48:52 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2010-11-30 14:48:52 +0000 |
commit | ae2ab76faca93cad3059808b14d02f5565275e31 (patch) | |
tree | 3c4065c573c2e2af58596efedaa0595f793f7f04 | |
parent | 391456aad790172c3cbbceb5544dd785c0e60a99 (diff) | |
download | gunmake-ae2ab76faca93cad3059808b14d02f5565275e31.tar.gz |
Check if the target-specific variable is the same as the global
variable, and if so don't try to update it. Savannah bug #31743.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | doc/make.texi | 10 | ||||
-rw-r--r-- | read.c | 3 | ||||
-rw-r--r-- | tests/scripts/features/targetvars | 10 |
4 files changed, 22 insertions, 6 deletions
@@ -1,3 +1,8 @@ +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. diff --git a/doc/make.texi b/doc/make.texi index 4d089aa..aa36e57 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -31,7 +31,7 @@ Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, @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 @@ -4295,10 +4295,10 @@ recipes, is propagated to the subsystem.@refill 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 @@ -1802,7 +1802,8 @@ record_target_var (struct nameseq *filenames, char *defn, 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); diff --git a/tests/scripts/features/targetvars b/tests/scripts/features/targetvars index 6afd48a..a9b8dbe 100644 --- a/tests/scripts/features/targetvars +++ b/tests/scripts/features/targetvars @@ -237,6 +237,16 @@ a: ; @echo "$(FOO)" 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! |