From: Akim Demaille Date: Sun, 25 Feb 2001 18:17:57 +0000 (+0000) Subject: * automake.in (&initialize_per_input): %targets_conditionals is X-Git-Tag: handle-languages~250 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5f457e16cb72f1dd9f48564dc9eb68850ffe5523;p=automake.git * automake.in (&initialize_per_input): %targets_conditionals is new. (&read_am_file): When slurping a rule, set the target related variable, and no variable related variable. (&file_contents): Likewise. * tests/vartar.test, tests/ctarget1.test: New. --- diff --git a/ChangeLog b/ChangeLog index 9a94c48d..c6baa684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-02-25 Akim Demaille + + * automake.in (&initialize_per_input): %targets_conditionals is + new. + (&read_am_file): When slurping a rule, set the target related + variable, and no variable related variable. + (&file_contents): Likewise. + * tests/vartar.test, tests/ctarget1.test: New. + + 2001-02-25 Akim Demaille * automake.in (&variable_defined, &variable_value_as_list_worker): diff --git a/TODO b/TODO index fbf67c01..1fc173ed 100644 --- a/TODO +++ b/TODO @@ -274,7 +274,6 @@ still be able to have a Makefile.am in each directory somehow; this might make editing conceptually easier. * finish up TAGS work -* `acinstall' * only remove libtool at top level? @@ -598,14 +597,6 @@ Then automake can use -MD -MH -MT 'foo.o foo.lo' -MF .deps/... ================================================================ -Things to do for autoconf: - -* patch autoreconf to run automake and aclocal. I've done this but it is - not really available. It can't be made available until automake - is officially released - -================================================================ - Libraries: * Should support standalone library along with subdir library in same diff --git a/automake.in b/automake.in index f99f8a41..5b9be4e3 100755 --- a/automake.in +++ b/automake.in @@ -5469,7 +5469,7 @@ sub variable_defined ($$) return 1; } - &am_line_error ($var, "\`$var' is target; expected variable") + &am_line_error ($var, "\`$var' is a target; expected a variable") if defined $targets{$var}; return 0; @@ -5813,7 +5813,7 @@ sub variable_value_as_list_worker { if (defined $targets{$var}) { - &am_line_error ($var, "\`$var' is target; expected variable"); + &am_line_error ($var, "\`$var' is a target; expected a variable"); } else { @@ -6126,27 +6126,25 @@ sub read_am_file { # Found a rule. $was_rule = 1; - if (defined $contents{$1} + if (defined $targets{$1} && (@conditional_stack - ? ! defined $conditional{$1} - : defined $conditional{$1})) + ? ! defined $target_conditional{$1} + : defined $target_conditional{$1})) { &am_line_error ($1, "$1 defined both conditionally and unconditionally"); } # Value here doesn't matter; for targets we only note # existence. -# FIXME: I don't understand the next line at all, it seems dead wrong --akim - $contents{$1} = 1; $targets{$1} = 1; my $cond_string = join ('', @conditional_stack); if (@conditional_stack) { - if ($conditional{$1}) + if ($target_conditional{$1}) { &check_ambiguous_conditional ($1, $cond_string); } - ${$conditional{$1}}{$cond_string} = '1'; + ${$target_conditional{$1}}{$cond_string} = '1'; } $content_lines{$1} = $.; $output_trailer .= $comment . $spacing . $cond_string . $_; @@ -6497,10 +6495,6 @@ sub initialize_per_input # read_am_file. %contents = (); - # This holds the names which are targets. These also appear in - # %contents. - %targets = (); - # This maps a variable name onto a flag. The flag is true iff the # variable was first defined with `+='. %var_was_plus_eq = (); @@ -6526,6 +6520,13 @@ sub initialize_per_input # This holds a 1 if a particular variable was examined. %content_seen = (); + # This holds the names which are targets. These also appear in + # %contents. + %targets = (); + + # Same as %CONDITIONAL, but for targets. + %target_conditional = (); + # This is the conditional stack. @conditional_stack = (); @@ -6840,7 +6841,7 @@ sub file_contents { # Free lance dependency. Output the rule for all the # targets instead of one by one. - if (!defined $contents{$targets}) + if (!defined $targets{$targets}) { # Some hair to avoid spurious trailing blank # when there are no dependencies. diff --git a/tests/Makefile.am b/tests/Makefile.am index b688a6f7..09095208 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -74,6 +74,7 @@ confsub.test \ confvar.test \ confvar2.test \ copy.test \ +ctarget1.test \ cxxansi.test \ cxxcpp.test \ cxxlibobj.test \ @@ -262,6 +263,7 @@ texinfo7.test \ texinfo8.test \ texinfo9.test \ unused.test \ +vartar.test \ version.test \ version2.test \ version3.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 8606cf0f..cf0a25b1 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -151,6 +151,7 @@ confsub.test \ confvar.test \ confvar2.test \ copy.test \ +ctarget1.test \ cxxansi.test \ cxxcpp.test \ cxxlibobj.test \ @@ -339,6 +340,7 @@ texinfo7.test \ texinfo8.test \ texinfo9.test \ unused.test \ +vartar.test \ version.test \ version2.test \ version3.test \