GNU bug report logs - #8665
automake should offer APIs to honour silent-rules verbosity from shell code in Makefiles

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: automake; Severity: wishlist; Reported by: Stefano Lattarini <stefano.lattarini@HIDDEN>; dated Thu, 12 May 2011 20:29:02 UTC; Maintainer for automake is bug-automake@HIDDEN.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 15 Jun 2012 08:21:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 15 04:21:33 2012
Received: from localhost ([127.0.0.1]:43636 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SfRmf-0004bf-5f
	for submit <at> debbugs.gnu.org; Fri, 15 Jun 2012 04:21:33 -0400
Received: from mail-bk0-f44.google.com ([209.85.214.44]:64057)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1SfRmd-0004bW-1S
	for 8665 <at> debbugs.gnu.org; Fri, 15 Jun 2012 04:21:31 -0400
Received: by bkty8 with SMTP id y8so2103431bkt.3
	for <8665 <at> debbugs.gnu.org>; Fri, 15 Jun 2012 01:18:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:mime-version:to:cc:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=eXaEX9Ub1bkaIoJVl4zA8xqCAx5LapdmipW6Vr9GSA0=;
	b=rwgVOhrwtdH062TTmCAMqwtI+eO9fPbP/CuX61WExDRd4XPG+icvtXQUhGy0AXiNdU
	bA3D9gPh+rlruzCezBMAt27ecBtI8rfkxI3KxOU8dnclxSaFhh01Js4PUua+JyIvr0av
	wD0XQfDvpw5cACkYcxeXbOylvJC0Hz/np/FVdKmGqozFNrbHPhyySvZQvx7B7KtrLrLz
	jlCgwNS0NO80VJE8aL6OlO2O4BMB6TEiMpPD4ZcuB71FicVV7GhciU/M5TaGk/BagFKR
	iSSaOgCdU6Vv4XOCPW1cB3MDroVlx5zRVpo3jTmIPxZqiO64NqY2J1I2IFtcHuOADbsw
	vcCQ==
Received: by 10.205.122.76 with SMTP id gf12mr2394396bkc.104.1339748312296;
	Fri, 15 Jun 2012 01:18:32 -0700 (PDT)
Received: from [87.4.94.80] (host80-94-dynamic.4-87-r.retail.telecomitalia.it.
	[87.4.94.80])
	by mx.google.com with ESMTPS id n19sm9162039bkv.14.2012.06.15.01.18.29
	(version=SSLv3 cipher=OTHER); Fri, 15 Jun 2012 01:18:30 -0700 (PDT)
Message-ID: <4FDAEFD4.9020405@HIDDEN>
Date: Fri, 15 Jun 2012 10:18:28 +0200
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: automake-patches@HIDDEN
Subject: Re: [PATCH 0/3] Determine whether silent rules are active from inside
	a make recipe
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

On 06/11/2012 04:52 PM, Stefano Lattarini wrote:
> [Resurrecting an old thread]
> 
> Reference: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8665>
> 
> Hi Jack, automakers, sorry for the shameful delay.
> 
> This patch series (for maint) should take care of the "easy" part of
> the bug, i.e., define a make variable that can be used from within the
> make recipes to determine whether make is being run in verbose mode
> (as with "make V=1") or quiet mode (as with "make V=0").
> 
> I will push by tomorrow if there is no objection.
> 
> Regards,
>   Stefano
> 
> Stefano Lattarini (3):
>   refactor: &define_verbose_var: accept a third optional argument
>   refactor: silent rules handling (a little)
>   silent: new $(AM_V_P) variable, tell if we're running in silent mode
> 
>  NEWS                          |    6 +++
>  automake.in                   |   46 ++++++++++++-----
>  doc/automake.texi             |   18 ++++++-
>  t/list-of-tests.mk            |    1 +
>  t/silent-obsolescent-warns.sh |   71 ++++++++++++++++++++++++++
>  t/silent6.sh                  |  110 +++++++++++++++++++----------------------
>  6 files changed, 180 insertions(+), 72 deletions(-)
>  create mode 100755 t/silent-obsolescent-warns.sh
> 
Pushed.

Regards,
  Stefano




Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 11 Jun 2012 14:55:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 11 10:55:42 2012
Received: from localhost ([127.0.0.1]:37982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Se61t-0002hy-43
	for submit <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:41 -0400
Received: from mail-wg0-f46.google.com ([74.125.82.46]:51307)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Se61q-0002hG-G1
	for 8665 <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:39 -0400
Received: by mail-wg0-f46.google.com with SMTP id dq10so3094075wgb.15
	for <8665 <at> debbugs.gnu.org>; Mon, 11 Jun 2012 07:53:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:in-reply-to:references;
	bh=/OpiVHEreRbmJx8bG7oEPo7rwj9GaFti4hGs1kC6pDA=;
	b=IktKJMi9/SvVllRdAADcOvWA4ZdMUPDbip02zrXC1eiYSGuKycilyViLbEsa1mI1a5
	pEfimRnQ+C0pSJUsmcDB0qGAhHq7zSMR5Hf4aIGy5KCD1xtLfGqbE5gSRcxa8f2+whYW
	d/FQy9PUj/fx7n1APLEn+1EycCgcYzyF/AYPm53kBEnuyZbUygjwSnXvitjfngPyB5mG
	c7OegQv+lFDhc0IlL3ISmUjEdPQWnvKYD112cXKXU+jnU6sDgCFqm5uOUAxv4Rbjj2dg
	Dn3qPP7gM1zXY7eBlYPQY24yD+8SzSM9Cqjp4RbQ8sziPgjwRM074hNzMcCZbdTtsRul
	sSDg==
Received: by 10.216.196.90 with SMTP id q68mr815829wen.130.1339426381176;
	Mon, 11 Jun 2012 07:53:01 -0700 (PDT)
Received: from localhost.localdomain
	(host96-95-dynamic.0-87-r.retail.telecomitalia.it. [87.0.95.96])
	by mx.google.com with ESMTPS id fo7sm24325830wib.9.2012.06.11.07.52.59
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 11 Jun 2012 07:53:00 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: automake-patches@HIDDEN
Subject: [PATCH 3/3] silent: new $(AM_V_P) variable,
	tell if we're running in silent mode
Date: Mon, 11 Jun 2012 16:52:41 +0200
Message-Id: <825722a190bcc939abcf129cafd896b4b84d0ecd.1339425852.git.stefano.lattarini@HIDDEN>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
X-Spam-Score: -0.9 (/)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -0.9 (/)

Addresses part of automake bug#8665.

* automake.in (handle_silent): Define a new make variable '$(AM_V_P)',
that expands to a shell conditional that can be used in make recipes to
determine whether they are being run in silent mode or not.  The choice
of the name derives from the LISP convention of appending the letter
'P' to denote a predicate (see also "the '-P' convention" in the Jargon
File); we do so for lack of a better convention.
* t/automake.texi, NEWS: Document the new variable.
* t/silent6.sh: Adjust and extend.  Move out the checks that didn't
actually deal with user extension of silent rules ...
* t/silent-obsolescent-warns.sh: ... into this test (bound to be
removed once 'maint' is merged into the 'master' branch).
* t/list-of-tests.mk: Add the new test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
---
 NEWS                          |    6 +++
 automake.in                   |    7 +++
 doc/automake.texi             |   18 ++++++-
 t/list-of-tests.mk            |    1 +
 t/silent-obsolescent-warns.sh |   71 ++++++++++++++++++++++++++
 t/silent6.sh                  |  110 +++++++++++++++++++----------------------
 6 files changed, 154 insertions(+), 59 deletions(-)
 create mode 100755 t/silent-obsolescent-warns.sh

diff --git a/NEWS b/NEWS
index cf45836..bced15f 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,12 @@ New in 1.12.2:
     input file.  Such a warning will also be present in the next
     Autoconf version (2.70).
 
+* Silent rules support:
+
+  - A new predefined $(AM_V_P) make variable is provided; it expands
+    to a shell conditional that can be used in recipes to know whether
+    make is being run in silent or verbose mode.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 New in 1.12.1:
diff --git a/automake.in b/automake.in
index 722a202..53bed2f 100644
--- a/automake.in
+++ b/automake.in
@@ -1235,6 +1235,13 @@ sub define_verbose_libtool ()
 sub handle_silent ()
 {
     return unless option 'silent-rules';
+    # Define "$(AM_V_P)", expanding to a shell conditional that can be
+    # used in make recipes to determine whether we are being run in
+    # silent mode or not.  The choice of the name derives from the LISP
+    # convention of appending the letter 'P' to denote a predicate (see
+    # also "the '-P' convention" in the Jargon File); we do so for lack
+    # of a better convention.
+    define_verbose_var ('P', 'false', ':');
     # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
     define_verbose_tagvar ('GEN');
     define_verbose_var ('at', '@');
diff --git a/doc/automake.texi b/doc/automake.texi
index 939fe44..1b57cd8 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -10966,15 +10966,31 @@ limitation should go away with time.
 @vindex @code{AM_DEFAULT_VERBOSITY}
 @vindex @code{AM_V}
 @vindex @code{AM_DEFAULT_V}
-To extend the silent mode to your own rules, you have two choices:
+To extend the silent mode to your own rules, you have few choices:
 
 @itemize @bullet
+
 @item
 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.  When output is to be verbose, both of these variables
 will expand to the empty string.
+
+@item
+You can silence a recipe unconditionally with @code{@@}, and then use
+the predefined variable @code{AM_V_P} to know whether make is being run
+in silent or verbose mode, adjust the verbose information your recipe
+displays accordingly:
+
+@example
+generate-headers:
+        @set -e; \
+        ... [commands defining a shell variable '$headers'] ...; \
+        if $(AM_V_P); then set -x; else echo " GEN   [headers]"; fi; \
+        rm -f $$headers && generate-header --flags $$headers
+@end example
+
 @item
 You can add your own variables, so strings of your own choice are shown.
 The following snippet shows how you would define your own equivalent of
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index 446157c..7d7e88e 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -976,6 +976,7 @@ t/silent6.sh \
 t/silent7.sh \
 t/silent8.sh \
 t/silent9.sh \
+t/silent-obsolescent-warns.sh \
 t/silentcxx.sh \
 t/silentcxx-gcc.sh \
 t/silentf77.sh \
diff --git a/t/silent-obsolescent-warns.sh b/t/silent-obsolescent-warns.sh
new file mode 100755
index 0000000..a95f118
--- /dev/null
+++ b/t/silent-obsolescent-warns.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+# Copyright (C) 2009-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/>.
+
+# Some checks about silent-rules mode and warnings.
+
+. ./defs || Exit 1
+
+cat >>configure.ac <<'EOF'
+AM_SILENT_RULES
+AC_OUTPUT
+EOF
+
+cat > Makefile.am <<'EOF'
+my_verbose = $(my_verbose_$(V))
+my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
+my_verbose_0 = @echo " PKG-GEN    $@";
+foo: foo.in
+	$(my_verbose)cp $(srcdir)/foo.in $@
+EOF
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+
+cat > configure.ac <<'END'
+AC_INIT([silent6], [1.0])
+AM_INIT_AUTOMAKE([-Wall])
+AC_CONFIG_FILES([Makefile])
+END
+
+rm -rf autom4te*.cache
+$ACLOCAL
+AUTOMAKE_fails
+grep 'my_verbose_\$(V.*non-POSIX ' stderr
+$AUTOMAKE -Wno-error
+
+# AM_SILENT_RULES should turn off the warning.
+echo 'AM_SILENT_RULES' >> configure.ac
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOMAKE
+grep 'AM_V_GEN' Makefile.in
+$AUTOMAKE --force -Wno-all -Wportability
+grep 'AM_V_GEN' Makefile.in
+
+# The 'silent-rules' option to AM_INIT_AUTOMAKE should work likewise.
+cat > configure.ac <<'END'
+AC_INIT([silent6], [1.0])
+AM_INIT_AUTOMAKE([silent-rules])
+AC_CONFIG_FILES([Makefile])
+END
+rm -rf autom4te*.cache
+$ACLOCAL
+$AUTOMAKE
+grep 'AM_V_GEN' Makefile.in
+$AUTOMAKE --force -Wno-all -Wportability
+grep 'AM_V_GEN' Makefile.in
+
+:
diff --git a/t/silent6.sh b/t/silent6.sh
index 280d25a..1d67a0c 100755
--- a/t/silent6.sh
+++ b/t/silent6.sh
@@ -20,15 +20,33 @@
 
 cat >>configure.ac <<'EOF'
 AM_SILENT_RULES
+AC_CONFIG_FILES([sub/Makefile])
 AC_OUTPUT
 EOF
 
-cat > Makefile.am <<'EOF'
+# We delegate all the work to the subdir makefile.  This is done
+# to ensure any command-line setting of $(V) gets correctly passed
+# down to recursive make invocations.
+echo SUBDIRS = sub > Makefile.am
+
+mkdir sub
+cat > sub/Makefile.am <<'EOF'
 my_verbose = $(my_verbose_$(V))
 my_verbose_ = $(my_verbose_$(AM_DEFAULT_VERBOSITY))
-my_verbose_0 = @echo GEN $@;
+my_verbose_0 = @echo " XGEN    $@";
+
+all-local: foo gen-headers
 
-all-local: foo
+list = 0 1 2
+.PHONY: gen-headers
+gen-headers:
+	@headers=`for i in $(list); do echo sub/$$i.h; done`; \
+	if $(AM_V_P); then set -x; else \
+	  echo " GEN     [headers]"; \
+	fi; \
+	rm -f $$headers || exit 1; \
+## Only fake header generation.
+	: generate-header --flags $$headers
 
 foo: foo.in
 	$(my_verbose)cp $(srcdir)/foo.in $@
@@ -36,72 +54,48 @@ EXTRA_DIST = foo.in
 CLEANFILES = foo
 EOF
 
-: >foo.in
+: > sub/foo.in
 
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
 
-./configure --enable-silent-rules
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^ *GEN foo *$' stdout
-grep 'cp ' stdout && Exit 1
+do_check ()
+{
+  case ${1-} in
+    --silent) silent=:;;
+    --verbose) silent=false;;
+    *) fatal_ "do_check(): incorrect usage";;
+  esac
+  shift
+  $MAKE clean
+  $MAKE ${1+"$@"} >output 2>&1 || { cat output; Exit 1; }
+  sed 's/^/  /' output
+  if $silent; then
+    $FGREP 'cp ' output && Exit 1
+    $FGREP 'generate-header' output && Exit 1
+    $FGREP 'rm -f' output && Exit 1
+    grep '[012]\.h' output && Exit 1
+    grep '^ XGEN    foo$' output
+    grep '^ GEN     \[headers\]$' output
+  else
+    $FGREP 'GEN ' output && Exit 1
+    $FGREP 'cp ./foo.in foo' output
+    $FGREP "rm -f sub/0.h sub/1.h sub/2.h" output
+    $FGREP "generate-header --flags sub/0.h sub/1.h sub/2.h" output
+  fi
+}
 
-$MAKE clean
-$MAKE V=1 >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep 'GEN ' stdout && Exit 1
-grep 'cp \.*/foo\.in foo' stdout
+./configure --enable-silent-rules
+do_check --silent
+do_check --verbose V=1
 
 $MAKE distclean
 
 ./configure --disable-silent-rules
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep 'GEN ' stdout && Exit 1
-grep 'cp \.*/foo\.in foo' stdout
-
-$MAKE clean
-$MAKE V=0 >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^ *GEN foo *$' stdout
-grep 'cp ' stdout && Exit 1
+do_check --verbose
+do_check --silent V=0
 
 $MAKE distclean
 
-$sleep
-# Things should also work with -Wall in AM_INIT_AUTOMAKE.
-cat > configure.ac <<'END'
-AC_INIT([silent6], [1.0])
-AM_INIT_AUTOMAKE([-Wall])
-AC_CONFIG_FILES([Makefile])
-END
-
-$ACLOCAL
-AUTOMAKE_fails
-$AUTOMAKE -Wno-error
-
-# AM_SILENT_RULES should turn off the warning.
-$sleep
-echo 'AM_SILENT_RULES' >> configure.ac
-$ACLOCAL
-$AUTOMAKE
-grep 'AM_V_GEN' Makefile.in
-$AUTOMAKE --force -Wno-all -Wportability
-grep 'AM_V_GEN' Makefile.in
-
-# The 'silent-rules' option to AM_INIT_AUTOMAKE should work likewise.
-$sleep
-cat > configure.ac <<'END'
-AC_INIT([silent6], [1.0])
-AM_INIT_AUTOMAKE([silent-rules])
-AC_CONFIG_FILES([Makefile])
-END
-$ACLOCAL
-$AUTOMAKE
-grep 'AM_V_GEN' Makefile.in
-$AUTOMAKE --force -Wno-all -Wportability
-grep 'AM_V_GEN' Makefile.in
-
 :
-- 
1.7.9.5





Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 11 Jun 2012 14:55:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 11 10:55:40 2012
Received: from localhost ([127.0.0.1]:37980 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Se61r-0002hi-4i
	for submit <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:39 -0400
Received: from mail-wg0-f46.google.com ([74.125.82.46]:51307)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Se61o-0002hG-9c
	for 8665 <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:37 -0400
Received: by mail-wg0-f46.google.com with SMTP id dq10so3094075wgb.15
	for <8665 <at> debbugs.gnu.org>; Mon, 11 Jun 2012 07:52:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:in-reply-to:references;
	bh=vzLEpLxAi+x/TF29zn7/dyJSEWYw53Nq0E4TxHHc1Ws=;
	b=w0r07bbd9bR0KZmDTo1iW6WRtvWMHKx4Qg0vtZi4fIIGGlnQENa1vq3POp29hM0X8y
	OAeGeDlHMrFujvxKkSiUtqISHMTlg/LYM1niJiQ/q2aRwrwTncTWLK521g9e9TH/u7JS
	wix4WyGCHKBi/YFPlJ6KfGetkHAypVRweuJjMaqDvJOBjLtXysFOuhDMOly5A/2fP125
	0VEIaqTnqt80ggI/obNeE5WwXiS9eKh7Ywiq7vT/XLVT/hNFvhJJREZleNQqMw30tPGO
	VO5ekaNgoCjRZtFiZz7WyWNcanN619jPFUBAhRFhruMazImfU5OfZp+ZcufenNQ1Aa2a
	klSA==
Received: by 10.180.92.69 with SMTP id ck5mr21505713wib.14.1339426379171;
	Mon, 11 Jun 2012 07:52:59 -0700 (PDT)
Received: from localhost.localdomain
	(host96-95-dynamic.0-87-r.retail.telecomitalia.it. [87.0.95.96])
	by mx.google.com with ESMTPS id fo7sm24325830wib.9.2012.06.11.07.52.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 11 Jun 2012 07:52:58 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: automake-patches@HIDDEN
Subject: [PATCH 2/3] refactor: silent rules handling (a little)
Date: Mon, 11 Jun 2012 16:52:40 +0200
Message-Id: <5f6e8015727560fc92d613bb7c531c21a03850ab.1339425852.git.stefano.lattarini@HIDDEN>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

* automake.in (handle_languages): Move definition of $(AM_V_GEN)
variable ...
(define_verbose_tagvar): ... and of '$(AM_V_at)' variable ...
(handle_silent): ... in this new subroutine.
(generate_makefile): Call it.

Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
---
 automake.in |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/automake.in b/automake.in
index 5d777c1..722a202 100644
--- a/automake.in
+++ b/automake.in
@@ -1206,7 +1206,6 @@ sub define_verbose_tagvar ($)
     if (option 'silent-rules')
       {
 	define_verbose_var ($name, '@echo "  '. $name . ' ' x (8 - length ($name)) . '" $@;');
-	define_verbose_var ('at', '@');
       }
 }
 
@@ -1233,6 +1232,14 @@ sub define_verbose_libtool ()
     return verbose_flag ('lt');
 }
 
+sub handle_silent ()
+{
+    return unless option 'silent-rules';
+    # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
+    define_verbose_tagvar ('GEN');
+    define_verbose_var ('at', '@');
+}
+
 
 ################################################################
 
@@ -1590,9 +1597,6 @@ sub handle_languages
 	  unless defined $done{$languages{'c'}};
 	define_linker_variable ($languages{'c'});
       }
-
-    # Always provide the user with 'AM_V_GEN' for 'silent-rules' mode.
-    define_verbose_tagvar ('GEN');
 }
 
 
@@ -8153,6 +8157,8 @@ sub generate_makefile ($$)
   handle_programs;
   handle_scripts;
 
+  handle_silent;
+
   # These must be run after all the sources are scanned.  They
   # use variables defined by &handle_libraries, &handle_ltlibraries,
   # or &handle_programs.
-- 
1.7.9.5





Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 11 Jun 2012 14:55:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 11 10:55:39 2012
Received: from localhost ([127.0.0.1]:37978 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Se61q-0002hg-Pw
	for submit <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:39 -0400
Received: from mail-wg0-f46.google.com ([74.125.82.46]:51307)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Se61m-0002hG-Ki
	for 8665 <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:35 -0400
Received: by mail-wg0-f46.google.com with SMTP id dq10so3094075wgb.15
	for <8665 <at> debbugs.gnu.org>; Mon, 11 Jun 2012 07:52:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references
	:in-reply-to:references;
	bh=XFy7hoI/DsDPy8+lVQRrZlGP57Mk3qMFDQjVeYqowdc=;
	b=WB0ac40EeH5lZeWQJfEDUalYvn1LSkmop9u7KpjLnaxajemOk0uqwa6LvDBfael8M9
	osLJf1auvVRPc9Uch8nLLDy0forVJQ6QDT4S3XPyc74/vHNzwmGP6eCtB9GhkFnxCPXe
	J/ns5l1nXpMrMYxxRKAGWARzTvbb4SUWa7xdUAEBjmebPYYp5bcUEJ9nSreYK7mp3Tfl
	B2I079X0HW7A4tYfHF3vOi+sp76rXUENMEbIgq8BZc5PfLrcwgsL+e4bKmw5gOmeUhIU
	Rj61l6ItpfIiMUnQNkpi+77JuHvXcHu/nK2IchCtGWDCSoJjTjkwDIp1YJXglALXfh56
	1cMw==
Received: by 10.216.132.150 with SMTP id o22mr6382689wei.109.1339426377065;
	Mon, 11 Jun 2012 07:52:57 -0700 (PDT)
Received: from localhost.localdomain
	(host96-95-dynamic.0-87-r.retail.telecomitalia.it. [87.0.95.96])
	by mx.google.com with ESMTPS id fo7sm24325830wib.9.2012.06.11.07.52.54
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 11 Jun 2012 07:52:55 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: automake-patches@HIDDEN
Subject: [PATCH 1/3] refactor: &define_verbose_var: accept a third optional
	argument
Date: Mon, 11 Jun 2012 16:52:39 +0200
Message-Id: <1f009dac2de393da1010a02a678131fac40d496d.1339425851.git.stefano.lattarini@HIDDEN>
X-Mailer: git-send-email 1.7.9.5
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
In-Reply-To: <cover.1339425851.git.stefano.lattarini@HIDDEN>
References: <cover.1339425851.git.stefano.lattarini@HIDDEN>
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

This is only required by future changes.

* automake.in (define_verbose_var): Accept a third optional argument,
specifying the value to assign to the given make variable when silent
rules are disabled.

Signed-off-by: Stefano Lattarini <stefano.lattarini@HIDDEN>
---
 automake.in |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/automake.in b/automake.in
index 5cf5a2c..5d777c1 100644
--- a/automake.in
+++ b/automake.in
@@ -1138,15 +1138,19 @@ sub verbose_private_var ($)
     return 'am__v_' . $name;
 }
 
-# define_verbose_var (NAME, VAL)
-# ------------------------------
-# For 'silent-rules' mode, setup VAR and dispatcher, to expand to VAL if silent.
-sub define_verbose_var ($$)
-{
-    my ($name, $val) = @_;
+# define_verbose_var (NAME, VAL-IF-SILENT, [VAL-IF-VERBOSE])
+# ----------------------------------------------------------
+# For 'silent-rules' mode, setup VAR and dispatcher, to expand to
+# VAL-IF-SILENT if silent, to VAL-IF-VERBOSE (defaulting to empty)
+# if not.
+sub define_verbose_var ($$;$)
+{
+    my ($name, $silent_val, $verbose_val) = @_;
+    $verbose_val = '' unless defined $verbose_val;
     my $var = verbose_var ($name);
     my $pvar = verbose_private_var ($name);
     my $silent_var = $pvar . '_0';
+    my $verbose_var = $pvar . '_1';
     if (option 'silent-rules')
       {
 	# For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V)
@@ -1155,10 +1159,13 @@ sub define_verbose_var ($$)
 	# See AM_SILENT_RULES in m4/silent.m4.
 	define_variable ($var, '$(' . $pvar . '_@'.'AM_V'.'@)', INTERNAL);
 	define_variable ($pvar . '_', '$(' . $pvar . '_@'.'AM_DEFAULT_V'.'@)', INTERNAL);
-	Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val,
-				    '', INTERNAL, VAR_ASIS)
+        Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE,
+                                    $silent_val, '', INTERNAL, VAR_ASIS)
 	  if (! vardef ($silent_var, TRUE));
-      }
+        Automake::Variable::define ($verbose_var, VAR_AUTOMAKE, '', TRUE,
+                                    $verbose_val, '', INTERNAL, VAR_ASIS)
+	  if (! vardef ($verbose_var, TRUE));
+}
 }
 
 # Above should not be needed in the general automake code.
-- 
1.7.9.5





Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 11 Jun 2012 14:55:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jun 11 10:55:36 2012
Received: from localhost ([127.0.0.1]:37974 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Se61n-0002hT-To
	for submit <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:36 -0400
Received: from mail-wg0-f46.google.com ([74.125.82.46]:51307)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1Se61k-0002hG-GZ
	for 8665 <at> debbugs.gnu.org; Mon, 11 Jun 2012 10:55:33 -0400
Received: by wgbdq10 with SMTP id dq10so3094075wgb.15
	for <8665 <at> debbugs.gnu.org>; Mon, 11 Jun 2012 07:52:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:cc:subject:date:message-id:x-mailer;
	bh=gbn4G8KxVaL6TNBP4BTvKu6CPsdOUdUyn/0exPEzZz0=;
	b=ViF7VbZfVC5EWVDQnkaGP2qUvRe+JzqAqHPQWnpu24XtA/XcmR/yc3rV5NkOvOrMV4
	3OmLxAeXNlObF5euT7gtXwLiyIfsNOuPzuWTYc/7g1HoIRuSNhdegM+WApKZGC63yz6Y
	mfm7fw9AC+qlnSC4QmLsi7667/VGydc3KiVepyCTr676ozAxX+yzRWkIOt3+Wd7bvL/Z
	d3N4Eb3R7oJqxvRpO1SMj5ywl3R9mcHZGOvtrzLd+ecaZ9KGBFb2V7xZsnIbITs5ucXb
	6egBIDIx5LdmNSVbij1iFcHBeNp+KOZ+nIjEfzg8JArhCGoNhDiSqhR/qYaug63+rLP+
	PTGw==
Received: by 10.216.228.224 with SMTP id f74mr6721092weq.217.1339426374842;
	Mon, 11 Jun 2012 07:52:54 -0700 (PDT)
Received: from localhost.localdomain
	(host96-95-dynamic.0-87-r.retail.telecomitalia.it. [87.0.95.96])
	by mx.google.com with ESMTPS id fo7sm24325830wib.9.2012.06.11.07.52.51
	(version=TLSv1/SSLv3 cipher=OTHER);
	Mon, 11 Jun 2012 07:52:52 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: automake-patches@HIDDEN
Subject: [PATCH 0/3] Determine whether silent rules are active from inside a
	make recipe
Date: Mon, 11 Jun 2012 16:52:38 +0200
Message-Id: <cover.1339425851.git.stefano.lattarini@HIDDEN>
X-Mailer: git-send-email 1.7.9.5
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

[Resurrecting an old thread]

Reference: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8665>

Hi Jack, automakers, sorry for the shameful delay.

This patch series (for maint) should take care of the "easy" part of
the bug, i.e., define a make variable that can be used from within the
make recipes to determine whether make is being run in verbose mode
(as with "make V=1") or quiet mode (as with "make V=0").

I will push by tomorrow if there is no objection.

Regards,
  Stefano

Stefano Lattarini (3):
  refactor: &define_verbose_var: accept a third optional argument
  refactor: silent rules handling (a little)
  silent: new $(AM_V_P) variable, tell if we're running in silent mode

 NEWS                          |    6 +++
 automake.in                   |   46 ++++++++++++-----
 doc/automake.texi             |   18 ++++++-
 t/list-of-tests.mk            |    1 +
 t/silent-obsolescent-warns.sh |   71 ++++++++++++++++++++++++++
 t/silent6.sh                  |  110 +++++++++++++++++++----------------------
 6 files changed, 180 insertions(+), 72 deletions(-)
 create mode 100755 t/silent-obsolescent-warns.sh

-- 
1.7.9.5





Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 22 Apr 2012 15:06:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 22 11:06:23 2012
Received: from localhost ([127.0.0.1]:47027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SLyMm-0002tY-FO
	for submit <at> debbugs.gnu.org; Sun, 22 Apr 2012 11:06:22 -0400
Received: from mail-we0-f172.google.com ([74.125.82.172]:56117)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1SLyMf-0002tH-M4
	for 8665 <at> debbugs.gnu.org; Sun, 22 Apr 2012 11:06:15 -0400
Received: by werb10 with SMTP id b10so8939641wer.3
	for <8665 <at> debbugs.gnu.org>; Sun, 22 Apr 2012 08:05:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:mime-version:to:cc:subject:content-type
	:content-transfer-encoding;
	bh=XMxwiSZy2hUnnP0aQuf3weKQeimhOanot1wqwEya6Vw=;
	b=Ygzj3aqTf5eR91G3Na8vYpOu9BSGoGfwJfPk3wPIoKSynH63BdyryjRtCmrkMETn81
	BLycHmO2yy6RO6cHlRD2tF3MChJPrVsqQ0e3q8y4I0QN7rfKACNRHqjVI8bPf9F+vyiL
	+bquwoK5QiFBcUbEraUzqFxtzTjDqzkU69PvMMbFZnKD8cw7Xp2kSeE19a+eo+n5m1U1
	WoGr4l5520YIa5RFClFB3kFzqST8RqYL8jFjp/whZcv/dcquuPQCZLHcLR+BZPpa8VPt
	w4XPyC6+hU4HDRjhFzlgbkY/xjxiuiMBkU7XundgNWRCODz9KdPPDe+KITUsntNMLekB
	O+LA==
Received: by 10.180.80.70 with SMTP id p6mr13689422wix.21.1335107131530;
	Sun, 22 Apr 2012 08:05:31 -0700 (PDT)
Received: from [82.60.30.33]
	(host33-30-dynamic.60-82-r.retail.telecomitalia.it. [82.60.30.33])
	by mx.google.com with ESMTPS id n20sm23578817wiw.5.2012.04.22.08.05.28
	(version=SSLv3 cipher=OTHER); Sun, 22 Apr 2012 08:05:29 -0700 (PDT)
Message-ID: <4F941E30.6020501@HIDDEN>
Date: Sun, 22 Apr 2012 17:05:20 +0200
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
MIME-Version: 1.0
To: 8665 <at> debbugs.gnu.org
Subject: Re: bug#8665: automake should offer APIs to honour silent-rules
	verbosity from shell code in Makefiles
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 8665
Cc: Jack Kelly <jack@HIDDEN>, Automake List <automake@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.6 (--)

Reviving and oldish bug report (and CC:ing the Automake list now).

Reference: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8665>

I wrote:
>
> A relevant excerpt [from the manual]:
>
>  You can add your own variables, so strings of your own choice are shown.
>  The following snippet shows how you would define your own equivalent of
>  AM_V_GEN:
>     pkg_verbose = $(pkg_verbose_$(V))
>     pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
>     pkg_verbose_0 = @echo PKG-GEN $@;
>     foo: foo.in
>         (pkg_verbose)cp $(srcdir)/foo.in $@

Jack Kelly replied:
>
> Yes. I think it would be nice to make a Makefile.am declaration or m4
> macro to generate this,

To which I replied:
>
> I agree.  The above idiom seems easy enough to automatize.  I'm not sure
> what the best syntax for this new feature would be, tough.

It could be something as simple as this maybe:

  AM_QUIET_PKG = PKG-GEN

which would output in the generated Makefile.in:

  AM_V_PKG = $(pkg_verbose_@AM_V@)
  am__V_PKG_ = $(pkg_verbose_@AM_DEFAULT_V@)
  am__V_PKG_0 = @echo $(AM_QUIET_PKG) $@;

so that an usage like:

  foo: foo.in
          $(AM_V_PKG)cp $(srcdir)/foo.in $@

in Makefile.am will produce at runtime:

  $ make foo V=0
  PKG-GEN foo

  $ make foo V=1
  cp ./foo.in foo

WDYT?

Regards,
  Stefano




Information forwarded to bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 13 May 2011 11:12:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 07:12:23 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QKqIB-0008BW-3y
	for submit <at> debbugs.gnu.org; Fri, 13 May 2011 07:12:23 -0400
Received: from mail-ww0-f46.google.com ([74.125.82.46])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKqI9-0008BL-2R
	for 8665 <at> debbugs.gnu.org; Fri, 13 May 2011 07:12:22 -0400
Received: by wwb28 with SMTP id 28so2687129wwb.15
	for <8665 <at> debbugs.gnu.org>; Fri, 13 May 2011 04:12:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:from:to:subject:date:user-agent:cc:references
	:in-reply-to:mime-version:content-type:content-transfer-encoding
	:message-id; bh=OesanhLXP5OhAlwIgFId6y8/mUu/gmbkkFkYEbBjlHM=;
	b=xdIqIeZxexW+rlSgMjnwMJER3nJDz0njVK4bK1+WioNJibIs59GRzZcPQwxr6noXpe
	IsuNffWTMJmIR2jR77OP2uLby93p89D4eDsgk0hqD/CDxGUnCe1RXUzeE68MFTqzM5Kd
	Cddi58MFFeQ+n1p7N/nW+J19w2CTVpXdMMi0c=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	b=vjnDa2h0RjlOWsstowX/WiuYPlzts1uGf8PC5RaXcuyLIjazVLO6KSI1iGzOCIofp9
	Rsx09HMgHNT+vRaaGa8IJiQyNMeeqyjxRoGqvCPY61zLSrjvMEhln105EmC9ibhl3JyH
	TF0/Fc/WLkSJuaZrUr2F6NQwu0bbIokBY12L8=
Received: by 10.216.28.1 with SMTP id f1mr815433wea.41.1305285135118;
	Fri, 13 May 2011 04:12:15 -0700 (PDT)
Received: from bigio.localnet
	(host130-37-dynamic.56-82-r.retail.telecomitalia.it [82.56.37.130])
	by mx.google.com with ESMTPS id t5sm1083272wes.9.2011.05.13.04.12.12
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 13 May 2011 04:12:13 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: Jack Kelly <jack@HIDDEN>
Subject: Re: bug#8665: automake should offer APIs to honour silent-rules
	verbosity from shell code in Makefiles
Date: Fri, 13 May 2011 13:12:03 +0200
User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )
References: <201105122227.43348.stefano.lattarini@HIDDEN>
	<201105131130.56162.stefano.lattarini@HIDDEN>
	<BANLkTi=71-rgJC2OeDJjSz-8zL=nd43fqw@HIDDEN>
In-Reply-To: <BANLkTi=71-rgJC2OeDJjSz-8zL=nd43fqw@HIDDEN>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201105131312.04557.stefano.lattarini@HIDDEN>
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: 8665
Cc: 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.0 (----)

On Friday 13 May 2011, Jack Kelly wrote:

> [snip]
>
> >> Maybe we should have a more general method of
> >> declaring silencing variables (like the $(AM_V_GEN), but also the
> >> others that echo 'CC' and friends. Then users who have unconventional
> >> setups can silence things without echoing 'GEN' everywhere.
> >>
> > If I understand correctly what you're suggesting, then I think the current
> > implementation already offers what you want; see the documentation for the
> > 'silent-rules' option at:
> >
> >  <http://www.gnu.org/software/automake/manual/html_node/Options.html>
> >
> > (I know, that is, er, "suboptimally" placed; a patch to fix this is still
> > pending).
> >
> > A relevant excerpt:
> >
> >  You can add your own variables, so strings of your own choice are shown.
> >  The following snippet shows how you would define your own equivalent of
> >  AM_V_GEN:
> >     pkg_verbose = $(pkg_verbose_$(V))
> >     pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
> >     pkg_verbose_0 = @echo PKG-GEN $@;
> >
> >     foo: foo.in
> >         (pkg_verbose)cp $(srcdir)/foo.in $@
> 
> Yes. I think it would be nice to make a Makefile.am declaration or m4
> macro to generate this,
>
I agree.  The above idiom seems easy enough to automatize.  I'm not sure
what the best syntax for this new feature would be, tough.

> the above was what I was looking for.
>
> -- Jack
> 

Regards,
  Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 13 May 2011 10:20:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 06:20:30 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QKpTx-0006yw-45
	for submit <at> debbugs.gnu.org; Fri, 13 May 2011 06:20:30 -0400
Received: from mail-ww0-f46.google.com ([74.125.82.46])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <endgame.dos@HIDDEN>) id 1QKpTu-0006yj-2d
	for 8665 <at> debbugs.gnu.org; Fri, 13 May 2011 06:20:27 -0400
Received: by wwb28 with SMTP id 28so2646320wwb.15
	for <8665 <at> debbugs.gnu.org>; Fri, 13 May 2011 03:20:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	bh=20I1xgggwdFm+LJw0Sqrj7pjlMkk0NQcE2uv3+ZZYiU=;
	b=rhpHSj6YoJp7TywSh300y/Y80rKEyNiwB4JRFutNHHoeqcd3HnfYOHDN4UbxYSg3KF
	y9VoPK2ON6G2gBl77SGGg/iwydJlnG3T43AxcfEMTPNkxrC0pozmFhVpw1nMfSx0e8lq
	CxxIRBto4hrAU0/wndUgbmGJCYy5rubwh+/XY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=G0gsKdTDTP6Giv+Pnhggsutv8vohcUpnwqlmNZggEoabpS/SMsyeSN1dKn2F724qqE
	kqH9Rhn3d/Fj/NcEYpw4t8fHJwV1h7bnWCDjCrGlkWWg1mEnvENzQe3+iNheHZVSmztW
	lUba0zhkW42RJpZS+FugUaDYR9/65/wNl2RVs=
MIME-Version: 1.0
Received: by 10.216.60.193 with SMTP id u43mr134888wec.103.1305282019896; Fri,
	13 May 2011 03:20:19 -0700 (PDT)
Received: by 10.216.161.19 with HTTP; Fri, 13 May 2011 03:20:19 -0700 (PDT)
In-Reply-To: <201105131130.56162.stefano.lattarini@HIDDEN>
References: <201105122227.43348.stefano.lattarini@HIDDEN>
	<BANLkTino5QDibqDdqftK3h+m=4coUuvViA@HIDDEN>
	<201105131130.56162.stefano.lattarini@HIDDEN>
Date: Fri, 13 May 2011 20:20:19 +1000
X-Google-Sender-Auth: wB-RG8q5pqX46Dd6YT0Z24TFES0
Message-ID: <BANLkTi=71-rgJC2OeDJjSz-8zL=nd43fqw@HIDDEN>
Subject: Re: bug#8665: automake should offer APIs to honour silent-rules
	verbosity from shell code in Makefiles
From: Jack Kelly <jack@HIDDEN>
To: 8665 <at> debbugs.gnu.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 8665
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.6 (---)

On Fri, May 13, 2011 at 7:30 PM, Stefano Lattarini
<stefano.lattarini@HIDDEN> wrote:
> Hello Jack, thanks for the feedback.
>
> On Friday 13 May 2011, Jack Kelly wrote:
>> Comments inline, after some snipping.
>>
>> On Fri, May 13, 2011 at 6:27 AM, Stefano Lattarini
>> <stefano.lattarini@HIDDEN> wrote:
>> > -snip intro-
>> >
>> > I thus propose we add an API of this kind. =A0At first, this might be =
as
>> > simple as just defining two proper `AM_V_ECHO' and `AM_Q_ECHO' variabl=
es;
>> > `AM_V_ECHO' should be `echo' when silent rules are in effect, and `:'
>> > when they are not; viceversa for `AM_Q_ECHO'.
>> >
>> > To give a simplified example of what I'm proposing:
>> >
>> > =A0$ cat > Makefile.am <<'END'
>> > =A0headers:
>> > =A0 =A0@... [commands defining a shell variable `$headers']; \
>> > =A0 =A0 $(AM_V_ECHO) "cd somedir && generate-header --flag $$headers";=
 \
>> > =A0 =A0 $(AM_Q_ECHO) "GEN headers"; \
>> > =A0 =A0 cd somedir && generate-header --flag $$headers
>>
>> If you're just echoing "GEN headers", is there any reason you can't
>> use $(AM_V_GEN) here?
>>
> Well, first of all, assuming that $(AM_V_ECHO) and $(AM_Q_ECHO) aren't
> available, using just $(AM_V_GEN) wouldn't be enough to silence the
> "cd somedir && generate-header --flag $$headers" message echoed by the
> rule above, and this clearly defies the purpose of having silent rules
> in the first place. =A0Also in case the generation of headers uses a
> timestamp file, say ".headers_timestamp" (which would probably be the
> case in a real-world example), the use of $(AM_V_GEN) woul cause the
> displaying of a leass appealing and IMHO slightly less clear message
> "GEN .headers_timpestamp".

You do have $(AM_V_at), though. I am persuaded by your arguments for
the general case.

> Also, thinking about more general situations, we might want to display
> some trimmed-down versions of $headers instead of the constant string
> `headers'; for example, we might want to display the number of headers
> that are being generated (an information that is available only to the
> shell running the rule, and not to the make process):
>
> -snip example-

Agreed.

>> Maybe we should have a more general method of
>> declaring silencing variables (like the $(AM_V_GEN), but also the
>> others that echo 'CC' and friends. Then users who have unconventional
>> setups can silence things without echoing 'GEN' everywhere.
>>
> If I understand correctly what you're suggesting, then I think the curren=
t
> implementation already offers what you want; see the documentation for th=
e
> 'silent-rules' option at:
>
> =A0<http://www.gnu.org/software/automake/manual/html_node/Options.html>
>
> (I know, that is, er, "suboptimally" placed; a patch to fix this is still
> pending).
>
> A relevant excerpt:
>
> =A0You can add your own variables, so strings of your own choice are show=
n.
> =A0The following snippet shows how you would define your own equivalent o=
f
> =A0AM_V_GEN:
> =A0 =A0 pkg_verbose =3D $(pkg_verbose_$(V))
> =A0 =A0 pkg_verbose_ =3D $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
> =A0 =A0 pkg_verbose_0 =3D @echo PKG-GEN $@;
>
> =A0 =A0 foo: foo.in
> =A0 =A0 =A0 =A0 (pkg_verbose)cp $(srcdir)/foo.in $@

Yes. I think it would be nice to make a Makefile.am declaration or m4
macro to generate this, the above was what I was looking for.

-- Jack




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 13 May 2011 09:31:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 13 05:31:16 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QKoiK-0005rQ-36
	for submit <at> debbugs.gnu.org; Fri, 13 May 2011 05:31:16 -0400
Received: from mail-wy0-f172.google.com ([74.125.82.172])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKoiH-0005rD-Cy
	for 8665 <at> debbugs.gnu.org; Fri, 13 May 2011 05:31:14 -0400
Received: by wyb29 with SMTP id 29so1885558wyb.3
	for <8665 <at> debbugs.gnu.org>; Fri, 13 May 2011 02:31:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:from:to:subject:date:user-agent:cc:references
	:in-reply-to:mime-version:content-type:content-transfer-encoding
	:message-id; bh=vNzIUdVVmP8DL/RBqOV7C2olgAFFOSjiXYO+iSrqAzg=;
	b=wzmazQCBl5vFpLPbSZkn89PI8nVC6UFcRjx76KDAFxYgN1MyPTkaHEOHaFmiSk8mmR
	9Fs5+etZu3Q7bxQKBoNDdBUws2hk0GHR2zKrJxWi4EclFMdnyq1Vk7/sEwT00cTewLdP
	S0AJ+A5V11X16nun0AW/ap9vpj+N6so9mrtaM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	b=orCKfqXbHVku6ovhUOS/T00Qcpna+UNzniR2vf+awpfrjmyQnedvSOMCtYrgunkXfd
	pPBdaBj9PfagYwY2gjH+0zsqLipuBAqmPZj8R0MjCJRaK9xLjWTBz+95MEbYbJ3awq7F
	kfvzrF8fPxevsNEE5Ju6DhfKvSKNO/WGU1haM=
Received: by 10.216.145.131 with SMTP id p3mr1118711wej.82.1305279067365;
	Fri, 13 May 2011 02:31:07 -0700 (PDT)
Received: from bigio.localnet
	(host130-37-dynamic.56-82-r.retail.telecomitalia.it [82.56.37.130])
	by mx.google.com with ESMTPS id c43sm1034980weo.18.2011.05.13.02.31.04
	(version=TLSv1/SSLv3 cipher=OTHER);
	Fri, 13 May 2011 02:31:05 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: Jack Kelly <jack@HIDDEN>
Subject: Re: bug#8665: automake should offer APIs to honour silent-rules
	verbosity from shell code in Makefiles
Date: Fri, 13 May 2011 11:30:55 +0200
User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )
References: <201105122227.43348.stefano.lattarini@HIDDEN>
	<BANLkTino5QDibqDdqftK3h+m=4coUuvViA@HIDDEN>
In-Reply-To: <BANLkTino5QDibqDdqftK3h+m=4coUuvViA@HIDDEN>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201105131130.56162.stefano.lattarini@HIDDEN>
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: 8665
Cc: 8665 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -4.0 (----)

Hello Jack, thanks for the feedback.

On Friday 13 May 2011, Jack Kelly wrote:
> Comments inline, after some snipping.
> 
> On Fri, May 13, 2011 at 6:27 AM, Stefano Lattarini
> <stefano.lattarini@HIDDEN> wrote:
> > -snip intro-
> >
> > I thus propose we add an API of this kind.  At first, this might be as
> > simple as just defining two proper `AM_V_ECHO' and `AM_Q_ECHO' variables;
> > `AM_V_ECHO' should be `echo' when silent rules are in effect, and `:'
> > when they are not; viceversa for `AM_Q_ECHO'.
> >
> > To give a simplified example of what I'm proposing:
> >
> >  $ cat > Makefile.am <<'END'
> >  headers:
> >    @... [commands defining a shell variable `$headers']; \
> >     $(AM_V_ECHO) "cd somedir && generate-header --flag $$headers"; \
> >     $(AM_Q_ECHO) "GEN headers"; \
> >     cd somedir && generate-header --flag $$headers
> 
> If you're just echoing "GEN headers", is there any reason you can't
> use $(AM_V_GEN) here?
>
Well, first of all, assuming that $(AM_V_ECHO) and $(AM_Q_ECHO) aren't
available, using just $(AM_V_GEN) wouldn't be enough to silence the
"cd somedir && generate-header --flag $$headers" message echoed by the
rule above, and this clearly defies the purpose of having silent rules
in the first place.  Also in case the generation of headers uses a
timestamp file, say ".headers_timestamp" (which would probably be the
case in a real-world example), the use of $(AM_V_GEN) woul cause the
displaying of a leass appealing and IMHO slightly less clear message
"GEN .headers_timpestamp".

Also, thinking about more general situations, we might want to display
some trimmed-down versions of $headers instead of the constant string
`headers'; for example, we might want to display the number of headers
that are being generated (an information that is available only to the
shell running the rule, and not to the make process):

  $ cat > Makefile.am <<'END'
  headers:
   @...
    $(AM_V_ECHO) "cd somedir && generate-header --flag $$headers"; \
    set x $$headers && shift && $(AM_Q_ECHO) "GEN $# headers"; \
    cd somedir && generate-header --flag $$headers

The use of $(AM_V_GEN) won't allow us to do something like this in a
easy and natural way.

> Maybe we should have a more general method of
> declaring silencing variables (like the $(AM_V_GEN), but also the
> others that echo 'CC' and friends. Then users who have unconventional
> setups can silence things without echoing 'GEN' everywhere.
>
If I understand correctly what you're suggesting, then I think the current
implementation already offers what you want; see the documentation for the
'silent-rules' option at:

 <http://www.gnu.org/software/automake/manual/html_node/Options.html>

(I know, that is, er, "suboptimally" placed; a patch to fix this is still
pending).

A relevant excerpt:

  You can add your own variables, so strings of your own choice are shown.
  The following snippet shows how you would define your own equivalent of
  AM_V_GEN: 
     pkg_verbose = $(pkg_verbose_$(V))
     pkg_verbose_ = $(pkg_verbose_$(AM_DEFAULT_VERBOSITY))
     pkg_verbose_0 = @echo PKG-GEN $@;
               
     foo: foo.in
         (pkg_verbose)cp $(srcdir)/foo.in $@

> >  END
> >  $ autoreconf ...
> >  $ ./configure --disable-silent-rules
> >  ...
> >  $ make headers
> >  cd somedir && generate-header --flag foo.h bar.h baz.h
> >  $ make headers V=0
> >  GEN headers
> >  $ ./configure --enable-silent-rules
> >  ...
> >  $ make headers
> >  GEN headers
> >  $ make headers V=1
> >  cd somedir && generate-header --flag foo.h bar.h baz.h
> >
> > Or maybe we could start being more general from the beginning, and define
> > a variable `AM_IS_SILENT' (say) that is defined to "yes" when silent rules
> > are in effect, and to "no" otherwise.
> 
> If you are going to do this, is it sufficient for it to be a variable,
> or does it need to be an AM_CONDITIONAL? I'm thinking a variable is
> fine.
>
Me too.  Also because verbosity of rules is expected to be overridable at
make runtime anyway (with the use of `make V=1' and `make V=0'), and
automake conditionals wouldn't play well with this.

Thanks,
  Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at 8665 <at> debbugs.gnu.org:


Received: (at 8665) by debbugs.gnu.org; 12 May 2011 22:59:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 12 18:59:45 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QKerA-0000ON-EE
	for submit <at> debbugs.gnu.org; Thu, 12 May 2011 18:59:44 -0400
Received: from mail-wy0-f172.google.com ([74.125.82.172])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <endgame.dos@HIDDEN>) id 1QKer6-0000O9-Vy
	for 8665 <at> debbugs.gnu.org; Thu, 12 May 2011 18:59:42 -0400
Received: by wyb29 with SMTP id 29so1627554wyb.3
	for <8665 <at> debbugs.gnu.org>; Thu, 12 May 2011 15:59:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	bh=siQDa9fjfh8NyMJnHaDBEMDEetbaynhroofSANsaslY=;
	b=I/1AnqD49jvUNPCZtQVrKYSGm8AvjkXtnbO+JHZntZb3tQEbQAAgbR0z+q8pknK6qE
	gCbnqLieg8GpWDQvYusXkp5CaoKTsohayDRg6iESAJk3xtXPlJwpF0O+Jg6ewO6uVy4D
	aSLf/YalUf58xJC4yTI6W3YalTcPYNfUlx+so=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=PxJ59Ho6miYk24mI/GOU+JXw83PXu9XXtZiF74QE9Ww2yZo0X8Wl/EgjhVvNWGZATE
	ItdwyXQco8UXkojrfRpIJfmtopEHCAH38icO+ODiSXWOhmPRcj8Ak/trEry7ygvD5oOS
	8xgSh4B9Ray9OX+OHgW2GVn3mzl6VkF4lLKGU=
MIME-Version: 1.0
Received: by 10.216.255.73 with SMTP id i51mr36866wes.88.1305241175083; Thu,
	12 May 2011 15:59:35 -0700 (PDT)
Received: by 10.216.161.19 with HTTP; Thu, 12 May 2011 15:59:35 -0700 (PDT)
In-Reply-To: <201105122227.43348.stefano.lattarini@HIDDEN>
References: <201105122227.43348.stefano.lattarini@HIDDEN>
Date: Fri, 13 May 2011 08:59:35 +1000
X-Google-Sender-Auth: qzNQ5ZGpA2VJvnaH2H6lS-48cpU
Message-ID: <BANLkTino5QDibqDdqftK3h+m=4coUuvViA@HIDDEN>
Subject: Re: bug#8665: automake should offer APIs to honour silent-rules
	verbosity from shell code in Makefiles
From: Jack Kelly <jack@HIDDEN>
To: 8665 <at> debbugs.gnu.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -3.6 (---)
X-Debbugs-Envelope-To: 8665
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.6 (---)

Comments inline, after some snipping.

On Fri, May 13, 2011 at 6:27 AM, Stefano Lattarini
<stefano.lattarini@HIDDEN> wrote:
> -snip intro-
>
> I thus propose we add an API of this kind. =A0At first, this might be as
> simple as just defining two proper `AM_V_ECHO' and `AM_Q_ECHO' variables;
> `AM_V_ECHO' should be `echo' when silent rules are in effect, and `:'
> when they are not; viceversa for `AM_Q_ECHO'.
>
> To give a simplified example of what I'm proposing:
>
> =A0$ cat > Makefile.am <<'END'
> =A0headers:
> =A0 =A0@... [commands defining a shell variable `$headers']; \
> =A0 =A0 $(AM_V_ECHO) "cd somedir && generate-header --flag $$headers"; \
> =A0 =A0 $(AM_Q_ECHO) "GEN headers"; \
> =A0 =A0 cd somedir && generate-header --flag $$headers

If you're just echoing "GEN headers", is there any reason you can't
use $(AM_V_GEN) here? Maybe we should have a more general method of
declaring silencing variables (like the $(AM_V_GEN), but also the
others that echo 'CC' and friends. Then users who have unconventional
setups can silence things without echoing 'GEN' everywhere.

> =A0END
> =A0$ autoreconf ...
> =A0$ ./configure --disable-silent-rules
> =A0...
> =A0$ make headers
> =A0cd somedir && generate-header --flag foo.h bar.h baz.h
> =A0$ make headers V=3D0
> =A0GEN headers
> =A0$ ./configure --enable-silent-rules
> =A0...
> =A0$ make headers
> =A0GEN headers
> =A0$ make headers V=3D1
> =A0cd somedir && generate-header --flag foo.h bar.h baz.h
>
> Or maybe we could start being more general from the beginning, and define
> a variable `AM_IS_SILENT' (say) that is defined to "yes" when silent rule=
s
> are in effect, and to "no" otherwise.

If you are going to do this, is it sufficient for it to be a variable,
or does it need to be an AM_CONDITIONAL? I'm thinking a variable is
fine.

-- Jack




Information forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 May 2011 20:28:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 12 16:28:13 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1QKcUW-0004Wn-Iy
	for submit <at> debbugs.gnu.org; Thu, 12 May 2011 16:28:12 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUU-0004Wa-5u
	for submit <at> debbugs.gnu.org; Thu, 12 May 2011 16:28:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUO-0005TZ-0L
	for submit <at> debbugs.gnu.org; Thu, 12 May 2011 16:28:05 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID,
	T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([140.186.70.17]:39970)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUN-0005TV-V1
	for submit <at> debbugs.gnu.org; Thu, 12 May 2011 16:28:03 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37181)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUN-00068n-1E
	for bug-automake@HIDDEN; Thu, 12 May 2011 16:28:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUL-0005T5-Ql
	for bug-automake@HIDDEN; Thu, 12 May 2011 16:28:02 -0400
Received: from mail-ww0-f49.google.com ([74.125.82.49]:51866)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@HIDDEN>) id 1QKcUL-0005T1-Lw
	for bug-automake@HIDDEN; Thu, 12 May 2011 16:28:01 -0400
Received: by wwb39 with SMTP id 39so1806666wwb.30
	for <bug-automake@HIDDEN>; Thu, 12 May 2011 13:28:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:from:to:subject:date:user-agent:mime-version
	:content-type:content-transfer-encoding:message-id;
	bh=lnEilVqAGWRXcKTfr4/Um6mAhD6ckONOQllB887XpKQ=;
	b=StHJJUoF2dhO5Pguhs3UuZA5Vs8zb9NEOxO0BGbDxgLYh3iNr9bxpUL9HDK0+itOpx
	WTJDy04kPy0U9mdSZmomU1o3Ck9g6o57rLG0t9zPh4FYD3Y5fZub+dz06qeIFoLHu55B
	5uofNRif++Osro2hIkmspjCW/kP6Y3JEHEwY8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:subject:date:user-agent:mime-version:content-type
	:content-transfer-encoding:message-id;
	b=trirw22VO0RrdrQkE8tNgX/QqDT81X0Tc0u0TOdu0D+ns1vj2gR489J5bfoA/yK8OS
	+9GlXJN2RT55MqhjvXmoU6Su72K1o8ov2Wonh8vg5KZTHJv3/VMRU2IgK6mbo99uzDkv
	FiPcxP2nnwnaoUz3BvIcpvFEtZS2kaZX9nPrk=
Received: by 10.227.196.198 with SMTP id eh6mr644155wbb.55.1305232080510;
	Thu, 12 May 2011 13:28:00 -0700 (PDT)
Received: from bigio.localnet
	(host57-97-dynamic.2-87-r.retail.telecomitalia.it [87.2.97.57])
	by mx.google.com with ESMTPS id z13sm965805wbd.12.2011.05.12.13.27.57
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 12 May 2011 13:27:59 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@HIDDEN>
To: bug-automake@HIDDEN
Subject: automake should offer APIs to honour silent-rules verbosity from
	shell code in Makefiles
Date: Thu, 12 May 2011 22:27:42 +0200
User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201105122227.43348.stefano.lattarini@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -5.1 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.1 (-----)

severity: wishlist
thanks

Hello automakers.

We all know that's not usual, for long and complex makefile rules, to
be, at least in part, unconditionally silenced (with a leading `@'), as
otherwise the noise/information ratio in the output would be too high.
Such rules usually use echo (or similar commands) to print "by hand"
relevant information that might be useful, e.g., in debugging.

In fact, some rules generated by Automake itself are written this way;
for example, various installation rules, or the rules to automatically
rebuild 'Makefile.in's from 'Makefile.am's -- let's see this last one,
to have a real-word example:

  $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
  @for dep in $?; do \
    case '$(am__configure_deps)' in \
      *$$dep*) \
        echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
        $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu && exit 0; \
        exit 1;; \
    esac; \
  done; \
  echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
  $(am__cd) $(top_srcdir) && $(AUTOMAKE) --gnu Makefile

The problem with such rules is that, when the 'silent-rules' option is
used, they do not respect the default or enforced verbosity; worse of all,
they have no proper way to do so, because automake does not presently
offer any API in this respect.

I thus propose we add an API of this kind.  At first, this might be as
simple as just defining two proper `AM_V_ECHO' and `AM_Q_ECHO' variables;
`AM_V_ECHO' should be `echo' when silent rules are in effect, and `:'
when they are not; viceversa for `AM_Q_ECHO'.

To give a simplified example of what I'm proposing:

  $ cat > Makefile.am <<'END'
  headers:
    @... [commands defining a shell variable `$headers']; \
     $(AM_V_ECHO) "cd somedir && generate-header --flag $$headers"; \
     $(AM_Q_ECHO) "GEN headers"; \
     cd somedir && generate-header --flag $$headers
 END
 $ autoreconf ...
 $ ./configure --disable-silent-rules
 ...
 $ make headers
 cd somedir && generate-header --flag foo.h bar.h baz.h
 $ make headers V=0
 GEN headers
 $ ./configure --enable-silent-rules
 ...
 $ make headers
 GEN headers
 $ make headers V=1
 cd somedir && generate-header --flag foo.h bar.h baz.h

Or maybe we could start being more general from the beginning, and define
a variable `AM_IS_SILENT' (say) that is defined to "yes" when silent rules
are in effect, and to "no" otherwise.

WDYT?

Regards,
  Stefano

P.S. JFTR, this report has been motivated by this other one:
     "check_JAVA does not support silent rules"
     <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8662>




Acknowledgement sent to Stefano Lattarini <stefano.lattarini@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-automake@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-automake@HIDDEN:
bug#8665; Package automake. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.