From: Stefano Lattarini Date: Thu, 24 May 2012 22:06:11 +0000 (+0200) Subject: general: assume '#' comment in make recipes are ok X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d00c2e352a1bd15f8c1069dbfcd0cd1e5a387de2;p=thirdparty%2Fautomake.git general: assume '#' comment in make recipes are ok 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 --- diff --git a/automake.in b/automake.in index a9d6ef846..f23673656 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 ad5513059..fbe0e31d2 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 d5ef07617..dea9e3906 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 8f80945c2..000000000 --- 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 . - -# 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 9f2714ffe..9dc8c9b99 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 50bf0578b..77ada5452 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 b7e2e2d1a..f97789375 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 b8db708eb..f6157231a 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 b86be7304..eeec7cddf 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 b159f0231..8db2d575d 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 f3340ffa3..aa2c968f5 100755 --- a/t/java-compile-install.sh +++ b/t/java-compile-install.sh @@ -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' diff --git a/t/java-compile-run-flat.sh b/t/java-compile-run-flat.sh index 32ccf2a2d..6823e56c9 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 $@ $@-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 diff --git a/t/java-compile-run-nested.sh b/t/java-compile-run-nested.sh index 033bcb71f..49a1c59ed 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 $@ $@-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 diff --git a/t/java-nobase.sh b/t/java-nobase.sh index ff72a1338..4b2b622fe 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 eec824719..90a2b8ca5 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: - +@echo ":: $$MAKEFLAGS ::"; : For debugging. + +@echo ":: $$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 28509018b..606428a58 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 064db2bbb..53a69556a 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 3d3ab0838..46590e7d2 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|[@]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 diff --git a/t/remake12.sh b/t/remake12.sh index 51f847621..dda55503f 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 3b05b6a74..32b40494e 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 4cffc28be..9d7ad8824 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 09901c770..60f3592ff 100755 --- a/t/tap-basic.sh +++ b/t/tap-basic.sh @@ -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 diff --git a/t/test-driver-is-distributed.sh b/t/test-driver-is-distributed.sh index 23a4d1803..1956d787c 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 6f1b81179..acc26ab9c 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