+2002-09-29 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ * tests/exeext3.test: New file.
+ * tests/Makefile.am (TESTS): Add exeext3.test.
+ * automake.in (%target_name): New hash.
+ (initialize_per_input): Reset %target_name.
+ (rule_define): Fill %target_name, and use it to detect targets
+ which have been registered with key X but really are X$(EXEEXT).
+
2002-09-28 Alexandre Duret-Lutz <duret_g@epita.fr>
For PR automake/360:
# This holds the names which are targets. These also appear in
# %contents. $targets{TARGET}{COND} is the location of the definition
-# of TARGET for condition COND.
+# of TARGET for condition COND. TARGETs should not include
+# a trailing $(EXEEXT), we record this in %target_name.
my %targets;
# $target_source{TARGET}{COND} is the filename where TARGET
# filename, *without* any line number.
my %target_source;
+# $target_name{TARGET}{COND} is the real name of TARGET (in condition COND).
+# The real name is often TARGET or TARGET$(EXEEXT), and TARGET never
+# contain $(EXEEXT)
+my %target_name;
+
# $target_owner{TARGET}{COND} the owner of TARGET in condition COND.
my %target_owner;
use constant TARGET_AUTOMAKE => 0; # Target defined by Automake.
%targets = ();
%target_source = ();
+ %target_name = ();
%target_owner = ();
@cond_stack = ();
# For now `foo:' will override `foo$(EXEEXT):'. This is temporary,
# though, so we emit a warning.
(my $noexe = $target) =~ s,\$\(EXEEXT\)$,,;
- if ($noexe ne $target && exists $targets{$noexe}{$cond})
+ if ($noexe ne $target
+ && exists $targets{$noexe}
+ && exists $targets{$noexe}{$cond}
+ && $target_name{$noexe}{$cond} ne $target)
{
# The no-exeext option enables this feature.
if (! defined $options{'no-exeext'})
return ();
}
+ # For now on, strip off $(EXEEXT) from $target, so we can diagnose
+ # a clash if `ctags$(EXEEXT):' is redefined after `ctags:'.
+ my $realtarget = $target;
$target = $noexe;
# A GNU make-style pattern rule has a single "%" in the target name.
prog_error ("\$target_source{$target}{$cond} exists, but \$targets"
. " doesn't.")
unless exists $targets{$target}{$cond};
+ prog_error ("\$target_source{$target}{$cond} exists, but \$target_name"
+ . " doesn't.")
+ unless exists $target_name{$target}{$cond};
my $oldowner = $target_owner{$target}{$cond};
$targets{$target}{$c} = $where->clone;
$target_source{$target}{$c} = $source;
$target_owner{$target}{$c} = $owner;
+ $target_name{$target}{$c} = $realtarget;
}
# Check the rule for being a suffix rule. If so, store in a hash.
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with autoconf; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Make sure we can override a program rule.
+
+. ./defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = maude
+
+maude$(EXEEXT):
+ yeah
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+$FGREP 'maude$(EXEEXT):' Makefile.in
+test 1 = `grep 'maude.*:' Makefile.in | wc -l`