Merge branch 'maint'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 08:27:27 +0000 (10:27 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 08:36:41 +0000 (10:36 +0200)
* 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 <stefano.lattarini@gmail.com>
1  2 
NEWS
automake.in
doc/automake.texi
t/confh-subdir-clean.sh
t/list-of-tests.mk
t/silent6.sh

diff --cc NEWS
Simple merge
diff --cc 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';
 -    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));
 -}
+     my $verbose_var = $pvar . '_1';
-     Automake::Variable::define ($silent_var, VAR_AUTOMAKE, '', TRUE, $val,
-                                 '', INTERNAL, VAR_ASIS)
 +    # 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));
  }
  
  # 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');
  }
  
 -    return unless option 'silent-rules';
+ sub handle_silent ()
+ {
 -    # *Always* provide the user with 'AM_V_GEN' for 'silent-rules' mode.
+     # 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)', unconditionally.
+     define_verbose_tagvar ('GEN');
+     define_verbose_var ('at', '@');
+ }
  
  ################################################################
  
Simple merge
Simple merge
Simple merge
diff --cc t/silent6.sh
  . ./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 $@