From 829f4fd04b7fe9e18ed91c236ed46ebce5b27cae Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 8 Oct 1999 06:32:24 +0000 Subject: * Fix test suite on DOS (PR/1344) * Fix target-specific vars bug (PR/1378) --- ChangeLog | 8 ++++++++ tests/ChangeLog | 5 +++++ tests/scripts/features/targetvars | 20 ++++++++++++++++++++ variable.c | 3 +-- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3b3166..69917cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1999-10-08 Paul D. Smith + + * variable.c (initialize_file_variables): Always recurse to + initialize the parent's file variables: the parent might not have + any rules to run so it might not have been initialized before + this--we need this to set up the chain properly for + target-specific variables. + 1999-09-23 Paul D. Smith * Version 3.78.1 released. diff --git a/tests/ChangeLog b/tests/ChangeLog index 871cab9..ef2ef62 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +1999-10-08 Paul D. Smith + + * scripts/features/targetvars: Add a check for PR/1378: + "Target-specific vars don't inherit correctly" + 1999-09-29 Paul D. Smith * test_driver.pl (get_osname): Change $fancy_file_names to diff --git a/tests/scripts/features/targetvars b/tests/scripts/features/targetvars index e9fe092..83bf9ed 100644 --- a/tests/scripts/features/targetvars +++ b/tests/scripts/features/targetvars @@ -105,4 +105,24 @@ $answer = "qvar = qvar\nqvar =\n"; &compare_output($answer,&get_logfile(1)); +# TEST #8 +# For PR/1378: Target-specific vars don't inherit correctly + +$makefile2 = &get_tmpfile; + +open(MAKEFILE,"> $makefile2"); +print MAKEFILE <<'EOF'; +foo: FOO = foo +bar: BAR = bar +foo: bar +bar: baz +baz: ; @echo $(FOO) $(BAR) +EOF +close(MAKEFILE); + +&run_make_with_options("$makefile2", "", &get_logfile); +$answer = "foo bar\n"; +&compare_output($answer, &get_logfile(1)); + + 1; diff --git a/variable.c b/variable.c index 377daf5..4eebb37 100644 --- a/variable.c +++ b/variable.c @@ -238,8 +238,7 @@ initialize_file_variables (file) l->next = &global_setlist; else { - if (file->parent->variables == 0) - initialize_file_variables (file->parent); + initialize_file_variables (file->parent); l->next = file->parent->variables; } } -- cgit v1.2.3