From a2c552e0f079d239f9fc52c2f4a1f418fb78db33 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 21 Oct 2001 18:10:20 +0000 Subject: [PATCH] * automake.in (&am_target_error): New. Use it where appropriate instead of... (&am_line_error): this. Using it for a target is a croak error. --- ChangeLog | 7 +++++++ automake.in | 31 ++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 780b5dd5..dfb4b67b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-10-21 Akim Demaille + + * automake.in (&am_target_error): New. + Use it where appropriate instead of... + (&am_line_error): this. + Using it for a target is a croak error. + 2001-10-21 Akim Demaille * automake.in (&am_macro_error): New. diff --git a/automake.in b/automake.in index f4ebbb63..6e82b046 100755 --- a/automake.in +++ b/automake.in @@ -3991,7 +3991,7 @@ sub handle_footer if variable_value ('SOURCES'); - &am_line_error ('.SUFFIXES', + am_target_error ('.SUFFIXES', "use variable `SUFFIXES', not target `.SUFFIXES'") if target_defined ('.SUFFIXES'); @@ -4203,13 +4203,13 @@ sub handle_factored_dependencies { my $x = $utarg; $x =~ s/(data|exec)-//; - &am_line_error ($utarg, "use `$x', not `$utarg'"); + am_target_error ($utarg, "use `$x', not `$utarg'"); } } if (&target_defined ('install-local')) { - &am_line_error ('install-local', + am_target_error ('install-local', "use `install-data-local' or `install-exec-local', " . "not `install-local'"); } @@ -4217,7 +4217,7 @@ sub handle_factored_dependencies if (!defined $options{'no-installinfo'} && &target_defined ('install-info-local')) { - &am_line_error ('install-info-local', + am_target_error ('install-info-local', "`install-info-local' target defined but " . "`no-installinfo' option not in use"); } @@ -6645,7 +6645,7 @@ sub rule_define ($$$$) ? ! defined $target_conditional{$target} : defined $target_conditional{$target})) { - &am_line_error ($target, + am_target_error ($target, "$target defined both conditionally and unconditionally"); } @@ -8077,7 +8077,7 @@ sub am_file_error # &am_macro_error ($MACRO, @ARGS) # ------------------------------- -# Report an error, @ARGS, about $MACRO. +# Report an error, @ARGS, about $MACRO. sub am_macro_error ($@) { my ($macro, @args) = @_; @@ -8085,6 +8085,16 @@ sub am_macro_error ($@) } +# &am_target_error ($TARGET, @ARGS) +# --------------------------------- +# Report an error, @ARGS, about the rule $TARGET. +sub am_target_error ($@) +{ + my ($target, @args) = @_; + am_file_error ($targets{$target}, @args); +} + + # &am_line_error ($SYMBOL or $LINE, @ARGS) # ---------------------------------------- # Report an error about $SYMBOL. The error message is composed of the @@ -8095,22 +8105,25 @@ sub am_line_error ($@) if ($symbol && "$symbol" ne '-1') { - my $where; if ($symbol =~ /^\d+$/) { # SYMBOL is a line number, then it must be a Makefile.am. - $where = "${am_file}.am:$symbol"; + am_file_error ("${am_file}.am:$symbol", @args); } elsif (defined $configure_vars{$symbol}) { # SYMBOL is a variable defined in configure.ac, so add the # appropriate line number. - $where = $configure_vars{$symbol}; + am_file_error ($configure_vars{$symbol}, @args); } elsif (defined $var_location{$symbol}) { croak "use am_macro_error for macros: $symbol\n"; } + elsif (defined $targets{$symbol}) + { + croak "use am_target_error for targets: $symbol\n"; + } else { # Couldn't find the line number. -- 2.43.5