2009-03-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Provide variables for silencing of user rules.
+ * automake.in (handle_languages): Always define `AM_V_GEN' and
+ `AM_V_at'.
+ * doc/automake.texi (Options): Document these flags.
+ * tests/silent7.test: New test.
+ * tests/Makefile.am: Update.
+
Redo variable naming for `silent' machinery.
The public variables are named `AM_V_' plus the compiler
short-hand now, e.g.: AM_V_CC, AM_V_CXXLD, AM_V_GEN. The
expansion, which are in turn enabled by @option{-Wportability}
(@pxref{Invoking Automake}).
+@vindex @code{AM_V_GEN}
+@vindex @code{AM_V_at}
+To extend the silent mode to your own rules, you can use the predefined
+variable @code{AM_V_GEN} as a prefix to commands that should output a
+status line in silent mode, and @code{AM_V_at} as a prefix to commands
+that should not output anything in silent mode. With @code{V=1}, these
+variables will expand to empty strings.
+
@item @option{std-options}
@cindex Options, @option{std-options}
@cindex @samp{make installcheck}, testing @option{--help} and @option{--version}
--- /dev/null
+#!/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 3, 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/>.
+
+# Check user extensibility of silent mode.
+
+. ./defs
+
+set -e
+
+cat >>configure.in <<'EOF'
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+all-local: foo
+
+## And here's how you should do it in your own code:
+foo: foo.in
+ $(AM_V_GEN)cp $(srcdir)/foo.in $@
+ $(AM_V_at)echo more >> $@
+
+EXTRA_DIST = foo.in
+CLEANFILES = foo
+EOF
+
+: >foo.in
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout && Exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+$MAKE distclean
+
+echo 'AUTOMAKE_OPTIONS = silent' >> Makefile.am
+$AUTOMAKE
+
+./configure
+$MAKE >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout
+grep 'cp ' stdout && Exit 1
+grep 'echo ' stdout && Exit 1
+
+$MAKE clean
+$MAKE V=1 >stdout || { cat stdout; Exit 1; }
+cat stdout
+grep 'GEN.*foo' stdout && Exit 1
+grep 'cp ' stdout
+grep 'echo ' stdout
+
+: