automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI 4/6] general: assume '#' comment in make recipes are


From: Stefano Lattarini
Subject: [Automake-NG] [FYI 4/6] general: assume '#' comment in make recipes are ok
Date: Fri, 25 May 2012 02:16:24 +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 <address@hidden>
---
 automake.in                             |    2 --
 t/autohdr3.sh                           |    4 ++--
 t/backslash-tricks.sh                   |    4 ++--
 t/comment3.sh                           |   31 -------------------------------
 t/condman3.sh                           |    4 ++--
 t/confh8.sh                             |    4 ++--
 t/dist-auxfile-2.sh                     |    2 +-
 t/dist-auxfile.sh                       |    4 ++--
 t/extra11.sh                            |    4 ++--
 t/insh2.sh                              |    2 +-
 t/java-compile-install.sh               |    4 ++--
 t/java-compile-run-flat.sh              |    8 ++++----
 t/java-compile-run-nested.sh            |    8 ++++----
 t/java-nobase.sh                        |    2 +-
 t/make-dryrun.tap                       |    4 ++--
 t/nobase-python.sh                      |    2 +-
 t/primary-prefix-couples-force-valid.sh |    2 +-
 t/remake-gnulib-add-acsubst.sh          |    2 +-
 t/remake12.sh                           |    6 +++---
 t/subobj5.sh                            |    4 ++--
 t/subpkg-yacc.sh                        |    2 +-
 t/tap-basic.sh                          |    2 +-
 t/test-driver-is-distributed.sh         |    2 +-
 t/transform3.sh                         |    4 ++--
 24 files changed, 40 insertions(+), 73 deletions(-)
 delete mode 100755 t/comment3.sh

diff --git a/automake.in b/automake.in
index a9d6ef8..f236736 100644
--- a/automake.in
+++ b/automake.in
@@ -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;
diff --git a/t/autohdr3.sh b/t/autohdr3.sh
index ad55130..fbe0e31 100755
--- a/t/autohdr3.sh
+++ b/t/autohdr3.sh
@@ -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
diff --git a/t/backslash-tricks.sh b/t/backslash-tricks.sh
index d5ef076..dea9e39 100755
--- a/t/backslash-tricks.sh
+++ b/t/backslash-tricks.sh
@@ -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
index 8f80945..0000000
--- a/t/comment3.sh
+++ /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
diff --git a/t/condman3.sh b/t/condman3.sh
index 9f2714f..9dc8c9b 100755
--- a/t/condman3.sh
+++ b/t/condman3.sh
@@ -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
diff --git a/t/confh8.sh b/t/confh8.sh
index 50bf057..77ada54 100755
--- a/t/confh8.sh
+++ b/t/confh8.sh
@@ -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
diff --git a/t/dist-auxfile-2.sh b/t/dist-auxfile-2.sh
index b7e2e2d..f977893 100755
--- a/t/dist-auxfile-2.sh
+++ b/t/dist-auxfile-2.sh
@@ -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
diff --git a/t/dist-auxfile.sh b/t/dist-auxfile.sh
index b8db708..f615723 100755
--- a/t/dist-auxfile.sh
+++ b/t/dist-auxfile.sh
@@ -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 '
diff --git a/t/extra11.sh b/t/extra11.sh
index b86be73..eeec7cd 100755
--- a/t/extra11.sh
+++ b/t/extra11.sh
@@ -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
diff --git a/t/insh2.sh b/t/insh2.sh
index b159f02..8db2d57 100755
--- a/t/insh2.sh
+++ b/t/insh2.sh
@@ -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
diff --git a/t/java-compile-install.sh b/t/java-compile-install.sh
index f3340ff..aa2c968 100755
--- a/t/java-compile-install.sh
+++ b/t/java-compile-install.sh
@@ -47,7 +47,7 @@ Baz.java:
        chmod a-w address@hidden && mv -f address@hidden $@
 
 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'
diff --git a/t/java-compile-run-flat.sh b/t/java-compile-run-flat.sh
index 32ccf2a..6823e56 100755
--- a/t/java-compile-run-flat.sh
+++ b/t/java-compile-run-flat.sh
@@ -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 $@ address@hidden
        $(edit_script) $< >address@hidden
        chmod a-w address@hidden && chmod a+x address@hidden && mv -f 
address@hidden $@
-       sed 's/^/ | /' $@ ;: for debugging.
+       sed 's/^/ | /' $@ # For debugging.
 
 EXTRA_DIST += jprog.sh
 CLEANFILES = jprog
diff --git a/t/java-compile-run-nested.sh b/t/java-compile-run-nested.sh
index 033bcb7..49a1c59 100755
--- a/t/java-compile-run-nested.sh
+++ b/t/java-compile-run-nested.sh
@@ -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 $@ address@hidden
        $(edit_script) $< >address@hidden
        chmod a-w address@hidden && chmod a+x address@hidden && mv -f 
address@hidden $@
-       sed 's/^/ | /' $@ ;: for debugging.
+       sed 's/^/ | /' $@ # For debugging.
 
 EXTRA_DIST = jprog.sh
 CLEANFILES = jprog
diff --git a/t/java-nobase.sh b/t/java-nobase.sh
index ff72a13..4b2b622 100755
--- a/t/java-nobase.sh
+++ b/t/java-nobase.sh
@@ -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
diff --git a/t/make-dryrun.tap b/t/make-dryrun.tap
index eec8247..90a2b8c 100755
--- a/t/make-dryrun.tap
+++ b/t/make-dryrun.tap
@@ -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:
-       address@hidden ":: $$MAKEFLAGS ::"; : For debugging.
+       address@hidden ":: $$MAKEFLAGS ::" # For debugging.
        +$(am__make_dryrun) || exit 1; echo ok > from-dry-mode
 END
 
diff --git a/t/nobase-python.sh b/t/nobase-python.sh
index 2850901..606428a 100755
--- a/t/nobase-python.sh
+++ b/t/nobase-python.sh
@@ -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
diff --git a/t/primary-prefix-couples-force-valid.sh 
b/t/primary-prefix-couples-force-valid.sh
index 064db2b..53a6955 100755
--- a/t/primary-prefix-couples-force-valid.sh
+++ b/t/primary-prefix-couples-force-valid.sh
@@ -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)'
diff --git a/t/remake-gnulib-add-acsubst.sh b/t/remake-gnulib-add-acsubst.sh
index 3d3ab08..46590e7 100755
--- a/t/remake-gnulib-add-acsubst.sh
+++ b/t/remake-gnulib-add-acsubst.sh
@@ -38,7 +38,7 @@ BUILT_SOURCES = foo.h
 edit_h = sed -e 's|address@hidden@|@foovar@|g'
 foo.h: foo.in.h
        $(edit_h) < $(srcdir)/foo.in.h > address@hidden
-       cat address@hidden;: For debugging.
+       cat address@hidden # For debugging.
        mv -f address@hidden $@
 EXTRA_DIST = foo.in.h
 MOSTLYCLEANFILES = foo.h foo.h-t
diff --git a/t/remake12.sh b/t/remake12.sh
index 51f8476..dda5550 100755
--- a/t/remake12.sh
+++ b/t/remake12.sh
@@ -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
diff --git a/t/subobj5.sh b/t/subobj5.sh
index 3b05b6a..32b4049 100755
--- a/t/subobj5.sh
+++ b/t/subobj5.sh
@@ -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)
diff --git a/t/subpkg-yacc.sh b/t/subpkg-yacc.sh
index 4cffc28..9d7ad88 100755
--- a/t/subpkg-yacc.sh
+++ b/t/subpkg-yacc.sh
@@ -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 \
diff --git a/t/tap-basic.sh b/t/tap-basic.sh
index 09901c7..60f3592 100755
--- a/t/tap-basic.sh
+++ b/t/tap-basic.sh
@@ -44,7 +44,7 @@ ok.test:
        echo 'ok 1' >> address@hidden
        echo 'not ok 2 # TODO' >>address@hidden
        echo 'ok 3 # SKIP' >>address@hidden
-       cat address@hidden ;: For debugging.
+       cat address@hidden # For debugging.
        mv -f address@hidden $@
 END
 
diff --git a/t/test-driver-is-distributed.sh b/t/test-driver-is-distributed.sh
index 23a4d18..1956d78 100755
--- a/t/test-driver-is-distributed.sh
+++ b/t/test-driver-is-distributed.sh
@@ -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
diff --git a/t/transform3.sh b/t/transform3.sh
index 6f1b811..acc26ab 100755
--- a/t/transform3.sh
+++ b/t/transform3.sh
@@ -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
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]