]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
general: assume '#' comment in make recipes are ok
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 24 May 2012 22:06:11 +0000 (00:06 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 24 May 2012 23:53:52 +0000 (01:53 +0200)
The Autoconf manual (2.69) reports:

    Some make implementations treat anything starting with a tab as
    a command for the current rule, even if the tab is immediately
    followed by a '#'.  The make from Tru64 Unix V5.1 is one of them.

The issue doesn't affect GNU make though, so we can zap another now
redundant automake time check

* automake.in (read_am_file): Don't report rules starting with a
"#" as unportable.
* t/comment3.sh: Remove as obsolete.
* Several tests: In make rules, use '#' comments rather than more
fragile ':' comments; e.g., instead of:

        : Processed header files should not be distributed.
        test ! -r $(distdir)/one.h

use:

        # Processed header files should not be distributed.
        test ! -r $(distdir)/one.h

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
24 files changed:
automake.in
t/autohdr3.sh
t/backslash-tricks.sh
t/comment3.sh [deleted file]
t/condman3.sh
t/confh8.sh
t/dist-auxfile-2.sh
t/dist-auxfile.sh
t/extra11.sh
t/insh2.sh
t/java-compile-install.sh
t/java-compile-run-flat.sh
t/java-compile-run-nested.sh
t/java-nobase.sh
t/make-dryrun.tap
t/nobase-python.sh
t/primary-prefix-couples-force-valid.sh
t/remake-gnulib-add-acsubst.sh
t/remake12.sh
t/subobj5.sh
t/subpkg-yacc.sh
t/tap-basic.sh
t/test-driver-is-distributed.sh
t/transform3.sh

index a9d6ef84661f3dc9f092f8e770e86d9d770f65af..f236736560a395367571ec3f559f1561636dd50d 100644 (file)
@@ -6333,8 +6333,6 @@ sub read_am_file ($$)
            $output_trailer .= $cond->subst_string;
            $output_trailer .= $_;
            $comment = $spacing = '';
-           error $where, "'#' comment at start of rule is unportable"
-             if $_ =~ /^\t\s*\#/;
        }
 
        $saw_bk = $new_saw_bk;
index ad5513059f76378ec8e894dc5ef45b4209babd25..fbe0e31d217beeefdc34b7be5cacd22ecb888d28 100755 (executable)
@@ -30,8 +30,8 @@ cat > Makefile.am <<'END'
 .PHONY: test
 check-local: test
 test: all
-       cat $(srcdir)/config.hin ;: For debugging.
-       cat config.h             ;: Likewise.
+       cat $(srcdir)/config.hin # For debugging.
+       cat config.h             # Likewise.
        grep '#.*GREPME' $(srcdir)/config.hin
        grep '#.*define.*GREPME' config.h
 END
index d5ef076179e88d0dddc61120fdad4a7d3330f02a..dea9e3906e5d4d6fef294d132dff4d86650c9128 100755 (executable)
@@ -54,8 +54,8 @@ test:
        test '$(var2)' = bar
        test '$(var3)' = '#'
        test '$(var4)' = \#
-       : Use '[', not 'test', here, so that spurious comments
-       : are ensured to cause syntax errors.
+       # Use '[', not 'test', here, so that spurious comments
+       # are ensured to cause syntax errors.
        [ $(var5) = ok ]
 
 # Yes, this file ends with a backslash-newline.  So what?
diff --git a/t/comment3.sh b/t/comment3.sh
deleted file mode 100755 (executable)
index 8f80945..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-2012 Free Software Foundation, Inc.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Make sure that '#' after a tab is a failure.
-# The Tru64 Unix V5.1 system make will pass these to the
-# shell, which in turn can't find '#' as a command.
-# Sigh.  Some vendors must be destroyed.
-
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-install-data-local:
-       # Tru64 Unix must die
-END
-
-$ACLOCAL
-AUTOMAKE_fails
-grep 'Makefile.am:2:.*#' stderr
index 9f2714ffe6770a1b53afc77217a5bbb4e228f62c..9dc8c9b997538b7a5e628278f72a168a3741cb09 100755 (executable)
@@ -34,14 +34,14 @@ endif
 
 .PHONY: test1 test2
 test1:
-       find $(mandir) ;: For debugging.
+       find $(mandir) # For debugging.
        test -f $(mandir)/man1/foo.1
        test -f $(mandir)/man4/6.4
        test ! -f $(mandir)/man2/bar.2
        test ! -f $(mandir)/man1/baz.1
        test ! -f $(mandir)/man5/zap.5
 test2:
-       find $(mandir) ;: For debugging.
+       find $(mandir) # For debugging.
        test -f $(mandir)/man2/bar.2
        test -f $(mandir)/man1/baz.1
        test -f $(mandir)/man5/zap.5
index 50bf0578b36a55eb860ee2fe0b4bd042c2d4f824..77ada54520d8c9cccae7a2f45ef6a50f1b3bbf8f 100755 (executable)
@@ -30,7 +30,7 @@ test0:
        @echo am__dist_common = $(am__dist_common)
        echo ' ' $(am__dist_common) ' ' | grep '[ /]one\.h\.in '
        echo ' ' $(am__dist_common) ' ' | grep '[ /]two\.h\.in '
-       : Processed header files should not be distributed.
+       # Processed header files should not be distributed.
        if echo ' ' $(am__dist_common) ' ' | grep '\.h '; then \
          exit 1; \
        else \
@@ -43,7 +43,7 @@ test2: distdir
        ls -l $(distdir)/*
        test -f $(distdir)/one.h.in
        test -f $(distdir)/two.h.in
-       : Processed header files should not be distributed.
+       # Processed header files should not be distributed.
        test ! -r $(distdir)/one.h
        test ! -r $(distdir)/two.h
 check-local: test0 test1 test2
index b7e2e2d1a9e9f55a12bc4555946bf4b7c96b0853..f97789375401a0d4b0c9ab81c1d1bd99a96e5325 100755 (executable)
@@ -34,7 +34,7 @@ END
 cat > Makefile.am <<'END'
 SUBDIRS = sub
 test: distdir
-       ls -l $(distdir) $(distdir)/* ;: For debugging.
+       ls -l $(distdir) $(distdir)/* # For debugging.
        test -f $(distdir)/sub/zardoz
 .PHONY: test
 check-local: test
index b8db708ebe177a68e487330717082c14d74762bc..f6157231a31585cd8c528fffa7a66d4dcac1ec25 100755 (executable)
@@ -46,8 +46,8 @@ END
   unindent >> Makefile.am <<'END'
     SUBDIRS = subdir
     test: distdir
-       ls -l $(distdir) $(distdir)/*      ;: For debugging.
-       @echo am__dist_common = $(am__dist_common) ;: Likewise.
+       ls -l $(distdir) $(distdir)/*              # For debugging.
+       @echo am__dist_common = $(am__dist_common) # Likewise.
        echo ' ' $(am__dist_common) ' ' | grep '[ /]$(auxdir)foo.txt '
        echo ' ' $(am__dist_common) ' ' | grep '[ /]$(auxdir)bar.sh '
        echo ' ' $(am__dist_common) ' ' | grep '[ /]$(auxdir)zardoz '
index b86be730456ac48d2b20b6fa870f01c0e0573ab9..eeec7cddfa43ff35e1e51e0e32d15960d6c1010d 100755 (executable)
@@ -46,7 +46,7 @@ prereq:
 
 .PHONY: test
 test: distdir
-       ls -l $(distdir) $(distdir)/*.dir ;: For debugging.
+       ls -l $(distdir) $(distdir)/*.dir # For debugging.
        diff a.t $(distdir)/a.t
        diff b.t $(distdir)/b.t
        test ! -r $(distdir)/c.t
@@ -62,7 +62,7 @@ test: distdir
        test ! -r $(distdir)/foo
        diff _zardoz_ $(distdir)/_zardoz_
 check-local:
-       ls -l . *.dir ;: For debugging.
+       ls -l $(srcdir) $(srcdir)/*.dir # For debugging.
        test -f $(srcdir)/a.t
        test -f $(srcdir)/b.t
        test ! -r $(srcdir)/c.t
index b159f02315b481adbbdc1b48c5d8b3b64f4edd5b..8db2d575d5ed174cd01e81ebd7bc48b0a2d6cadb 100755 (executable)
@@ -24,7 +24,7 @@ cat > Makefile.am << 'END'
 pkgdata_DATA =
 .PHONY: test
 test: distdir
-       find $(distdir) ;: For debugging.
+       find $(distdir) # For debugging.
        echo ' ' $(am__dist_common) ' ' | grep '[ /]install-sh '
        test -f $(distdir)/install-sh
 END
index f3340ffa3733294a0ef53b6e58bcaee9eaaeca71..aa2c968f5248eb968ce106fffd25851e5ef1d68e 100755 (executable)
@@ -47,7 +47,7 @@ Baz.java:
        chmod a-w $@-t && mv -f $@-t $@
 
 test:
-       ls -l $(srcdir) . ;: For debugging.
+       ls -l $(srcdir) . # For debugging.
        test   -f $(srcdir)/Foo.java
        test   -f $(srcdir)/Bar.java
        test   -f Foo2.java
@@ -62,7 +62,7 @@ test:
        test   -f classjava.stamp
 
 test-install:
-       ls -l $(javadir) ;: For debugging.
+       ls -l $(javadir) # For debugging.
        test   -f '$(javadir)/bClass.class'
        test   -f '$(javadir)/aClass.class'
        test   -f '$(javadir)/Zardoz.class'
index 32ccf2a2d47cdf44127c789b3c8f3d4ef5676f9c..6823e56c973c12e829a403fa06b38e9c92a32fee 100755 (executable)
@@ -42,8 +42,8 @@ cat > Makefile.am <<'END'
 EXTRA_DIST = # Will be updated later.
 
 test-built:
-       ls -l $(srcdir)               ;: For debugging.
-       test $(srcdir) = . || ls -l . ;: Likewise.
+       ls -l $(srcdir)               # For debugging.
+       test $(srcdir) = . || ls -l . # Likewise.
        test -f $(srcdir)/Main.java
        test -f $(srcdir)/HelloStream.java
        test -f $(srcdir)/PkgLocation.jin
@@ -54,7 +54,7 @@ test-built:
        test -f classjava.stamp
 
 test-installed:
-       ls -l $(javadir) ;: For debugging.
+       ls -l $(javadir) # For debugging.
        test -f $(javadir)/HelloStream.class
        test -f $(javadir)/PkgLocation.class
        test -f $(javadir)/Main.class
@@ -83,7 +83,7 @@ jprog: jprog.sh
        rm -f $@ $@-t
        $(edit_script) $< >$@-t
        chmod a-w $@-t && chmod a+x $@-t && mv -f $@-t $@
-       sed 's/^/ | /' $@ ;: for debugging.
+       sed 's/^/ | /' $@ # For debugging.
 
 EXTRA_DIST += jprog.sh
 CLEANFILES = jprog
index 033bcb71f0f42dfad550b2c370249565b0b7b2c7..49a1c59ed13701252099bb071f010de1d027a06c 100755 (executable)
@@ -45,8 +45,8 @@ cat > Makefile.am <<'END'
 SUBDIRS = bin jprog tests
 
 test-built:
-       ls -l $(srcdir)/*             ;: For debugging.
-       test $(srcdir) = . || ls -l * ;: Likewise.
+       ls -l $(srcdir)/*             # For debugging.
+       test $(srcdir) = . || ls -l * # Likewise.
        test -f $(srcdir)/jprog/Main.java
        test -f $(srcdir)/jprog/HelloStream.java
        test -f $(srcdir)/jprog/PkgLocation.jin
@@ -57,7 +57,7 @@ test-built:
        test -f jprog/classjprogclass.stamp
 
 test-installed:
-       ls -l $(jprogclassdir) ;: For debugging.
+       ls -l $(jprogclassdir) # For debugging.
        test -f $(jprogclassdir)/HelloStream.class
        test -f $(jprogclassdir)/Main.class
        test -f $(jprogclassdir)/PkgLocation.class
@@ -88,7 +88,7 @@ jprog: jprog.sh
        rm -f $@ $@-t
        $(edit_script) $< >$@-t
        chmod a-w $@-t && chmod a+x $@-t && mv -f $@-t $@
-       sed 's/^/ | /' $@ ;: for debugging.
+       sed 's/^/ | /' $@ # For debugging.
 
 EXTRA_DIST = jprog.sh
 CLEANFILES = jprog
index ff72a13387d7a861085ef25f916703bb762fdb32..4b2b622fe77ca5ab561ea3356c698c7ba2e6191d 100755 (executable)
@@ -40,7 +40,7 @@ sub2/Baz.java:
 
 .PHONY: test-install
 test-install:
-       find $(prefix) ;: For debugging.
+       find $(prefix) # For debugging.
        test   -f $(javadir)/sub/subsub/Foo.class
        test   -f $(javadir)/sub/Bar.class
        test   -f $(javadir)/sub2/Baz.class
index eec824719cb0724250f56cb5f5be016a6965934e..90a2b8ca590ff44a6f2ba471f8283ce1856dd7b9 100755 (executable)
@@ -30,10 +30,10 @@ all:
 foo:
        $(MAKE) all
 notdry:
-       @echo ":: $$MAKEFLAGS ::"; : For debugging.
+       @echo ":: $$MAKEFLAGS ::" # For debugging.
        $(am__make_dryrun) && exit 1; exit 0
 dry:
-       +@echo ":: $$MAKEFLAGS ::"; : For debugging.
+       +@echo ":: $$MAKEFLAGS ::" # For debugging.
        +$(am__make_dryrun) || exit 1; echo ok > from-dry-mode
 END
 
index 28509018b6d47aae13f04405f74decaaa8385f0c..606428a58e5855e11b319983b6cc3aecc3bbfbbe 100755 (executable)
@@ -30,7 +30,7 @@ my_PYTHON = one.py sub/base.py
 nobase_my_PYTHON = two.py sub/nobase.py
 
 test-install-data: install-data
-       find inst -print; : For debugging.
+       find inst -print # For debugging.
        test   -f inst/my/one.py
        test   -f inst/my/one.pyc
        test   -f inst/my/two.py
index 064db2bbb40eb7d7ccf7bd52b587506da48abe24..53a69556ade2f6403d16dc26566afac5b9d16228 100755 (executable)
@@ -46,7 +46,7 @@ x_HEADERS = bar.h
 installcheck-local: test
 .PHONY: test
 test:
-       (cd '$(prefix)' && find .);: For debugging.
+       (cd '$(prefix)' && find .) # For debugging.
        ls -l '$(libdir)/foo$(EXEEXT)'
        test -f '$(libdir)/foo$(EXEEXT)'
        test -x '$(libdir)/foo$(EXEEXT)'
index 3d3ab083816ba1c34540ffc8f887f4246fcdf01c..46590e7d2f07e0e186e4135b0a19a6886c0baf99 100755 (executable)
@@ -38,7 +38,7 @@ BUILT_SOURCES = foo.h
 edit_h = sed -e 's|[@]foovar@|@foovar@|g'
 foo.h: foo.in.h
        $(edit_h) < $(srcdir)/foo.in.h > $@-t
-       cat $@-t;: For debugging.
+       cat $@-t # For debugging.
        mv -f $@-t $@
 EXTRA_DIST = foo.in.h
 MOSTLYCLEANFILES = foo.h foo.h-t
index 51f84762105bb45b9ce8ef36ce77058bf312ba1c..dda55503f114e8fc7a3841b64c6421e0fdaead05 100755 (executable)
@@ -62,17 +62,17 @@ test -f Makefile
 $sleep
 sed "s/%MAGIC3%/$magic3/" >> Makefile <<'END'
 my-check:
-       ls -l . $(srcdir) ;: For debugging.
+       ls -l . $(srcdir) # For debugging.
        test -f $(srcdir)/quux.am
        test -f $(srcdir)/quux.in
        test -f $(srcdir)/bot.in
        test -f $(srcdir)/top.in
        test ! -r $(srcdir)/zardoz.am
        test ! -r $(srcdir)/zardoz.in
-       grep FOO zardoz ;: For debugging.
+       grep FOO zardoz # For debugging.
        test x'$(FOO)' = x'%MAGIC3%'
 test:
-       ls -l ;: For debugging.
+       ls -l # For debugging.
        test x'$(FOO)' = x'dummy'
 .PHONY: test my-check
 END
index 3b05b6a74176e419a63bc6b3c129beb096162f4e..32b40494e4a681861d9844abfded9172a0b29396 100755 (executable)
@@ -34,11 +34,11 @@ wish_SOURCES = generic/a.c
 
 .PHONY: test-distdir test-build
 test-distdir: distdir
-       ls -l $(distdir) $(distdir)/* ;: For debugging.
+       ls -l $(distdir) $(distdir)/* # For debugging.
        test ! -r $(distdir)/a.c
        test -f $(distdir)/generic/a.c
 test-build: all
-       ls -l . generic ;: For debugging.
+       ls -l . generic # For debugging.
        test -f generic/a.$(OBJEXT)
        test -f wish$(EXEEXT)
        test ! -r a.$(OBJEXT)
index 4cffc28beea49d3db5b1ee0bbb4581b129c84c04..9d7ad88246b869ba65ddb8068acb9b960cb9e66f 100755 (executable)
@@ -69,7 +69,7 @@ EXTRA_liblib_a_SOURCES = bar.y
 dist-hook:
        test -d $(top_distdir)
        test -d $(distdir)
-       find $(top_distdir) $(distdir) ;: For debugging.
+       find $(top_distdir) $(distdir) # For debugging.
        test -f $(top_distdir)/MU.c
        test ! -f $(distdir)/MU.c
        for suf in y c; do \
index 09901c7706b1dca690a3e9be9e6fb4009076b492..60f3592ffd21a03a48e63929d3b0cb4b8410eb20 100755 (executable)
@@ -44,7 +44,7 @@ ok.test:
        echo 'ok 1' >> $@-t
        echo 'not ok 2 # TODO' >>$@-t
        echo 'ok 3 # SKIP' >>$@-t
-       cat $@-t ;: For debugging.
+       cat $@-t # For debugging.
        mv -f $@-t $@
 END
 
index 23a4d18038bd12076c5e23dc1db1f978c18471bf..1956d787c4602b072769f1a0861c3fa76ead0077 100755 (executable)
@@ -46,7 +46,7 @@ END
     SUBDIRS = tests
     check-local: test-top
     test-top: distdir
-       ls -l \$(distdir) \$(distdir)/* ;: For debugging.
+       ls -l \$(distdir) \$(distdir)/* # For debugging.
        test -f \$(distdir)/$test_driver
     .PHONY: test-top
 END
index 6f1b81179ed3074b8326b4763b7f20ba10695b45..acc26ab9c369edf8f99bd26fd2013e554a758c91 100755 (executable)
@@ -37,7 +37,7 @@ pkglib_LIBRARIES = libzap.a
 pkglibexec_SCRIPTS = mu
 
 test-install: install
-       find $(prefix) ;: For debugging.
+       find $(prefix) # For debugging.
        test   -f $(bindir)/gnu-foo
        test   -x $(bindir)/gnu-foo
        test   -f $(datadir)/foo/bar.txt
@@ -49,7 +49,7 @@ test-install: install
        test ! -d $(libexecdir)/gnu-foo
 
 test-installdirs: installdirs
-       find $(prefix) ;: For debugging.
+       find $(prefix) # For debugging.
        test   -d $(datadir)/foo
        test ! -d $(datadir)/gnu-foo
        test   -d $(libdir)/foo