From: Tom Tromey Date: Sun, 18 Aug 2002 22:26:37 +0000 (+0000) Subject: For PR automake/347: X-Git-Tag: Release-1-6d~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7b3d9d49cd58df8be9d73fa5a7b5ce49e20f1a2;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 7e900c763..d46a5415d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-08-17 Tom Tromey + + 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 * lib/am/depend2.am: Use correct name for dependency file in diff --git a/automake.in b/automake.in index cce7b51c2..def05002c 100755 --- a/automake.in +++ b/automake.in @@ -145,7 +145,7 @@ my $libdir = "@datadir@/@PACKAGE@-@APIVERSION@"; 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 = @@ -7257,6 +7257,11 @@ sub rule_define ($$$$) ? ! 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) diff --git a/tests/Makefile.am b/tests/Makefile.am index 4701322b3..addf303a7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -268,6 +268,7 @@ output4.test \ output5.test \ package.test \ parse.test \ +percent.test \ pluseq.test \ pluseq2.test \ pluseq3.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 5aab2c777..ed91ebd9c 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -52,7 +52,6 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LIBS = @LIBS@ LN = @LN@ -LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -356,6 +355,7 @@ output4.test \ output5.test \ package.test \ parse.test \ +percent.test \ pluseq.test \ pluseq2.test \ pluseq3.test \ diff --git a/tests/percent.test b/tests/percent.test new file mode 100755 index 000000000..25b4b8bf8 --- /dev/null +++ b/tests/percent.test @@ -0,0 +1,24 @@ +#!/bin/sh + +# Test to make sure that -Wportability understands %-style pattern +# rules. + +. $srcdir/defs + +set -e + +cat >>configure.in <Makefile.am <