From 18251c4633134c704464d7c567d82a110ab820c8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Mar 2005 19:21:34 +0000 Subject: [PATCH] Fixed Savannah bug #12266. --- ChangeLog | 9 +++++++++ main.c | 2 +- read.c | 4 ++-- tests/ChangeLog | 7 ++++++- tests/scripts/variables/DEFAULT_TARGET | 21 ++++++++++++++++++++- 5 files changed, 38 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8d7dcbbb..58b650c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-03-09 Boris Kolpackov + + * main.c (main): Use o_file instead of o_default when defining + the .DEFAULT_TARGET special variable. + + * read.c (eval): Use define_variable_global() instead of + define_variable() when setting new value for the .DEFAULT_TARGET + special variable. Fixes Savannah bug #12266. + 2005-03-04 Boris Kolpackov * imlicit.c (pattern_search): Mark files for which an implicit diff --git a/main.c b/main.c index c20be9b0..750ded3b 100644 --- a/main.c +++ b/main.c @@ -1553,7 +1553,7 @@ main (int argc, char **argv, char **envp) { struct variable *v = define_variable ( - ".DEFAULT_TARGET", 15, "", o_default, 0); + ".DEFAULT_TARGET", 15, "", o_file, 0); default_target_name = &v->value; } diff --git a/read.c b/read.c index c7ff6c68..772ef8c1 100644 --- a/read.c +++ b/read.c @@ -1262,8 +1262,8 @@ eval (struct ebuffer *ebuf, int set_default) if (!reject) { - (void) define_variable ( - ".DEFAULT_TARGET", 15, t->name, o_file, 0); + (void) define_variable_global ( + ".DEFAULT_TARGET", 15, t->name, o_file, 0, NILF); break; } } diff --git a/tests/ChangeLog b/tests/ChangeLog index ce8f460c..7fa8f867 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,6 +1,11 @@ +2005-03-09 Boris Kolpackov + + * scripts/variables/DEFAULT_TARGET: Add a test for Savannah + bug #12266. + 2005-03-04 Boris Kolpackov - * features/patternrules: Add a test fo Savannah bug #12202. + * scripts/features/patternrules: Add a test for Savannah bug #12202. 2005-03-03 Boris Kolpackov diff --git a/tests/scripts/variables/DEFAULT_TARGET b/tests/scripts/variables/DEFAULT_TARGET index 76b2a23d..d8f11739 100644 --- a/tests/scripts/variables/DEFAULT_TARGET +++ b/tests/scripts/variables/DEFAULT_TARGET @@ -3,6 +3,7 @@ $description = "Test the .DEFAULT_TARGET special variable."; $details = ""; + # Test #1: basic logic. # run_make_test(' @@ -45,7 +46,7 @@ run_make_test(' 512); -# Test #2: more than one target. +# Test #3: more than one target. # run_make_test(' .DEFAULT_TARGET := foo bar @@ -55,5 +56,23 @@ run_make_test(' 512); +# Test #4: Savannah bug #12226. +# +run_make_test(' +define rule +foo: ; @echo $$@ +endef + +define make-rule +$(eval $(rule)) +endef + +$(call make-rule) + +', +'', +'foo'); + + # This tells the test driver that the perl test script executed properly. 1;