]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Don't let an envvar setting of "$fail" cause build failure.
authorJim Meyering <jim@meyering.net>
Sat, 31 Oct 2009 16:47:58 +0000 (17:47 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 31 Oct 2009 16:51:38 +0000 (17:51 +0100)
Without this change, in a project using an automake-generated
Makefile, "make fail=anything" would fail inappropriately,
due to the `test -z "$$fail"' at the end of this emitted rule:

* lib/am/subdirs.am ($(RECURSIVE_TARGETS)): Initialize "fail=" to keep
an envvar setting of that variable from causing unwarranted failure.
($(RECURSIVE_CLEAN_TARGETS)): Likewise.
* tests/subdir10.test: New test.
* tests/Makefile.am: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
Makefile.in
lib/Automake/Makefile.in
lib/Makefile.in
lib/am/subdirs.am
tests/Makefile.am
tests/Makefile.in
tests/subdir10.test [new file with mode: 0755]

index 5313f4ed1af2f2b145f03dd81d9cafb8c618ee91..178e6fed1c32076fa045acb97cf606679cafe2b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-31  Jim Meyering  <meyering@redhat.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Don't let an envvar setting of "$fail" cause build failure.
+       Without this change, in a project using an automake-generated
+       Makefile, "make fail=anything" would fail inappropriately,
+       due to the `test -z "$$fail"' at the end of this emitted rule:
+       * lib/am/subdirs.am ($(RECURSIVE_TARGETS)): Initialize "fail=" to keep
+       an envvar setting of that variable from causing unwarranted failure.
+       ($(RECURSIVE_CLEAN_TARGETS)): Likewise.
+       * tests/subdir10.test: New test.
+       * tests/Makefile.am: Update.
+
 2009-10-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Sync auxiliary files from upstream.
index c522390217875905bec6bb07d93b3fd60b798f7d..1772111519b2b877a0a785c9ca6e3e98aa05f5b3 100644 (file)
@@ -377,7 +377,7 @@ uninstall-binSCRIPTS:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
@@ -402,7 +402,7 @@ $(RECURSIVE_TARGETS):
        fi; test -z "$$fail"
 
 $(RECURSIVE_CLEAN_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
index ea5da72ff45fcb60ed2a4e5a40cec51f093c77c2..95c67bf4e8a3b8c23b763041fea3d0dafe947a42 100644 (file)
@@ -327,7 +327,7 @@ uninstall-nodist_perllibDATA:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
@@ -352,7 +352,7 @@ $(RECURSIVE_TARGETS):
        fi; test -z "$$fail"
 
 $(RECURSIVE_CLEAN_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
index 4eb619e9fabf5393459bcbf34fed4fd3218dfdf3..ac7f26b82e711605700dfeacd36a8b1574150f68 100644 (file)
@@ -300,7 +300,7 @@ uninstall-dist_scriptDATA:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
@@ -325,7 +325,7 @@ $(RECURSIVE_TARGETS):
        fi; test -z "$$fail"
 
 $(RECURSIVE_CLEAN_TARGETS):
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
index b86e674a464da0bb6fa072b4edf3811de2ceb6ce..9c01a8c6daec637021c7b863d391a6cdd102ec6f 100644 (file)
@@ -36,7 +36,7 @@ AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \
 $(RECURSIVE_TARGETS):
 ## Using $failcom allows "-k" to keep its natural meaning when running a
 ## recursive rule.
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
@@ -75,7 +75,7 @@ maintainer-clean: maintainer-clean-recursive
 $(RECURSIVE_CLEAN_TARGETS):
 ## Using $failcom allows "-k" to keep its natural meaning when running a
 ## recursive rule.
-       @failcom='exit 1'; \
+       @fail= failcom='exit 1'; \
        for f in x $$MAKEFLAGS; do \
          case $$f in \
            *=* | --[!k]*);; \
index 98829c9ac3c90fdf2c07531b3708d61655a78c96..2c2e89a85836a1ccf41e937d075a5bfa13eef210 100644 (file)
@@ -617,6 +617,7 @@ subdir6.test \
 subdir7.test \
 subdir8.test \
 subdir9.test \
+subdir10.test \
 subdirbuiltsources.test \
 subcond.test \
 subcond2.test \
index d12b8504d436e64b4aa5085eba9d636049369f44..96bad893a5c4035ce578d95af716bbf49c222636 100644 (file)
@@ -851,6 +851,7 @@ subdir6.test \
 subdir7.test \
 subdir8.test \
 subdir9.test \
+subdir10.test \
 subdirbuiltsources.test \
 subcond.test \
 subcond2.test \
diff --git a/tests/subdir10.test b/tests/subdir10.test
new file mode 100755 (executable)
index 0000000..c71216b
--- /dev/null
@@ -0,0 +1,39 @@
+#! /bin/sh
+# Copyright (C) 2009  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/>.
+
+# SUDBIRS with $fail set in the environment.
+
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub
+
+cat >> configure.in <<'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+echo SUBDIRS = sub >Makefile.am
+: > sub/Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+env fail=1 $MAKE all clean
+
+Exit 0