Fixed Savannah bug #12266.

This commit is contained in:
Boris Kolpackov 2005-03-09 19:21:34 +00:00
parent 2860d3b247
commit 18251c4633
5 changed files with 38 additions and 5 deletions

View File

@ -1,3 +1,12 @@
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
* 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 <boris@kolpackov.net> 2005-03-04 Boris Kolpackov <boris@kolpackov.net>
* imlicit.c (pattern_search): Mark files for which an implicit * imlicit.c (pattern_search): Mark files for which an implicit

2
main.c
View File

@ -1553,7 +1553,7 @@ main (int argc, char **argv, char **envp)
{ {
struct variable *v = define_variable ( struct variable *v = define_variable (
".DEFAULT_TARGET", 15, "", o_default, 0); ".DEFAULT_TARGET", 15, "", o_file, 0);
default_target_name = &v->value; default_target_name = &v->value;
} }

4
read.c
View File

@ -1262,8 +1262,8 @@ eval (struct ebuffer *ebuf, int set_default)
if (!reject) if (!reject)
{ {
(void) define_variable ( (void) define_variable_global (
".DEFAULT_TARGET", 15, t->name, o_file, 0); ".DEFAULT_TARGET", 15, t->name, o_file, 0, NILF);
break; break;
} }
} }

View File

@ -1,6 +1,11 @@
2005-03-09 Boris Kolpackov <boris@kolpackov.net>
* scripts/variables/DEFAULT_TARGET: Add a test for Savannah
bug #12266.
2005-03-04 Boris Kolpackov <boris@kolpackov.net> 2005-03-04 Boris Kolpackov <boris@kolpackov.net>
* features/patternrules: Add a test fo Savannah bug #12202. * scripts/features/patternrules: Add a test for Savannah bug #12202.
2005-03-03 Boris Kolpackov <boris@kolpackov.net> 2005-03-03 Boris Kolpackov <boris@kolpackov.net>

View File

@ -3,6 +3,7 @@ $description = "Test the .DEFAULT_TARGET special variable.";
$details = ""; $details = "";
# Test #1: basic logic. # Test #1: basic logic.
# #
run_make_test(' run_make_test('
@ -45,7 +46,7 @@ run_make_test('
512); 512);
# Test #2: more than one target. # Test #3: more than one target.
# #
run_make_test(' run_make_test('
.DEFAULT_TARGET := foo bar .DEFAULT_TARGET := foo bar
@ -55,5 +56,23 @@ run_make_test('
512); 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. # This tells the test driver that the perl test script executed properly.
1; 1;