+2002-08-17 Tom Tromey <tromey@redhat.com>
+
+ For PR automake/347:
+ * automake.in (rule_define): Given portability warning if "%" seen
+ in target name.
+ (TARGET_PATTERN): Added `%'.
+ * tests/Makefile.am (TESTS): Added percent.test.
+ * tests/percent.test: New file.
+
2002-08-15 Art Haas <ahaas@neosoft.com>
* lib/am/depend2.am: Use correct name for dependency file in
my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
my $WHITE_PATTERN = '^\s*' . "\$";
my $COMMENT_PATTERN = '^#';
-my $TARGET_PATTERN='[$a-zA-Z_.@][-.a-zA-Z0-9_(){}/$+@]*';
+my $TARGET_PATTERN='[$a-zA-Z_.@%][-.a-zA-Z0-9_(){}/$+@%]*';
# A rule has three parts: a list of targets, a list of dependencies,
# and optionally actions.
my $RULE_PATTERN =
? ! exists $target_conditional{$target}
: exists $target_conditional{$target});
+ # A GNU make-style pattern rule has a single "%" in the target name.
+ msg ('portability', $where,
+ "`%'-style pattern rules are a GNU make extension")
+ if $target =~ /^[^%]*%[^%]*$/;
+
# Value here doesn't matter; for targets we only note existence.
$targets{$target} = $where;
if ($cond)
--- /dev/null
+#!/bin/sh
+
+# Test to make sure that -Wportability understands %-style pattern
+# rules.
+
+. $srcdir/defs
+
+set -e
+
+cat >>configure.in <<EOF
+AC_PROG_CC
+EOF
+
+cat >Makefile.am <<EOF
+bin_PROGRAMS = liver
+liver_SOURCES = foo.c
+
+%.o: %.c
+ echo "gnu make extension"
+EOF
+
+$ACLOCAL
+$AUTOMAKE -Wportability && exit 1
+exit 0