From: Stefano Lattarini Date: Fri, 15 Jun 2012 08:27:27 +0000 (+0200) Subject: Merge branch 'maint' X-Git-Tag: v1.12b~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b1697bd9b600cec62b8d52c56d80c60d39108a7;p=thirdparty%2Fautomake.git Merge branch 'maint' * maint: tests: minor reorganization of few tests fixup: adjust t/list-of-tests.mk for renamed/added tests subdirs: enhance coverage, tweak and rename few tests sync: update files from upstream with "make fetch" py-compile: consistently quote 'like this', not `like this'. docs: recursive make considered harmful docs: clean rules are not run in reverse order of build rules anymore silent: new $(AM_V_P) variable, tell if we're running in silent mode refactor: silent rules handling (a little) refactor: &define_verbose_var: accept a third optional argument + Extra non-trivial edits: These are due to the fact that support for silent rules is enabled unconditionally these days (since commit 'v1.12-34-g14141f2' of 2012-05-01, "silent rules: support for them is always active now"). * automake.in: In the new silent related code, do not ever check whether the 'silent-rules' option is active; just assume support for silent rules is enabled. * t/silent-obsolescent-warns.sh: Remove as obsolete. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini --- 7b1697bd9b600cec62b8d52c56d80c60d39108a7 diff --cc automake.in index e5f95ee64,cfc48bf73..373e25949 --- a/automake.in +++ b/automake.in @@@ -1138,25 -1138,34 +1138,32 @@@ sub verbose_private_var ($ return 'am__v_' . $name; } - # define_verbose_var (NAME, VAL) - # ------------------------------ - # For silent rules, 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. ++# For silent rules, 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) - # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY). - # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead. - # 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, - $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)); -} + # For typical 'make's, 'configure' replaces AM_V (inside @@) with $(V) + # and AM_DEFAULT_V (inside @@) with $(AM_DEFAULT_VERBOSITY). + # For strict POSIX 2008 'make's, it replaces them with 0 or 1 instead. + # 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. @@@ -1190,8 -1203,10 +1197,7 @@@ sub silent_flag ( sub define_verbose_tagvar ($) { my ($name) = @_; - if (option 'silent-rules') - { - define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); - } + define_verbose_var ($name, '@echo " '. $name . ' ' x (8 - length ($name)) . '" $@;'); - define_verbose_var ('at', '@'); } # define_verbose_texinfo @@@ -1217,6 -1232,21 +1223,20 @@@ sub define_verbose_libtool ( return verbose_flag ('lt'); } + 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. ++ # *Always* provide the user with '$(AM_V_GEN)', unconditionally. + define_verbose_tagvar ('GEN'); + define_verbose_var ('at', '@'); + } + ################################################################ diff --cc t/silent6.sh index f8ad681d4,1d67a0cd0..c7e7819f1 --- a/t/silent6.sh +++ b/t/silent6.sh @@@ -19,17 -19,34 +19,34 @@@ . ./defs || Exit 1 cat >>configure.ac <<'EOF' -AM_SILENT_RULES + AC_CONFIG_FILES([sub/Makefile]) AC_OUTPUT EOF - cat > Makefile.am <<'EOF' - AUTOMAKE_OPTIONS = -Wno-portability-recursive + # 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' ++AUTOMAKE_OPTIONS = -Wno-portability-recursive 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 + all-local: foo gen-headers + + 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 $@