automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1-491-g8eda774
Date: Wed, 27 Jun 2012 11:33:04 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=8eda774e3d2311513a35c49d7cad5e05c5fd9e03

The branch, ng/master has been updated
       via  8eda774e3d2311513a35c49d7cad5e05c5fd9e03 (commit)
       via  9defd1ee421a319c9e19f4c5e47da534067b0aea (commit)
       via  918c16551aa842a6a601dddf27672374b9e2c7d6 (commit)
       via  f855e98b434d74489e19aded9b598e6969068975 (commit)
       via  ebc92e19939b215d76804fde2e51a5850bcf23a0 (commit)
       via  0fcbd7c19e18265a4d2ca9f2158ec98daf4d67a9 (commit)
       via  e58e5c97e1dabe42e8b2925b6b046887a56a8b6e (commit)
       via  041fe15b40fd0d28927b8b0d3ebe40f72f42de4e (commit)
       via  0cf8c1b7ae1c45f286ab92c7769d9f3de6094cd5 (commit)
       via  244af89ee9da7b9224e1900d4be606f2e6d97757 (commit)
       via  1f2a0986c1787568acefd00849ffb2d6d2f69c26 (commit)
       via  ec45429837a0fc2d74354cf92d5e9828563b15de (commit)
       via  2e51882b115a5e71e197c775135fcc36b1c048a9 (commit)
       via  c66d183123ba0aaa8bd9e8750dbfbf1b99e39cf8 (commit)
       via  c0e725abfcba609f0d962938e70f93daa62cdb83 (commit)
       via  9d5c8e0e46e9e3650f67af20cb03174cd5773fae (commit)
       via  be756642bf96bffcd70a92af37caa398f1e82c57 (commit)
       via  931cdfb8953d6ad0f4e3023bf7a870955c04d0ac (commit)
       via  6c5d0d3a8b805f8e4fa9808ed75722e654bfae87 (commit)
       via  1ec288788159d18f4a5d5f705072f4fded4629e0 (commit)
       via  1202aff29bb3fe8428cc32b079c3cc79d8130bfd (commit)
       via  2e757c6261fe69fc83efba6b6ca89b2ad0b89d87 (commit)
       via  f2c84c39cb94151701c0c430a35299a6c47d6043 (commit)
      from  20cff0bd2db32b7a79f3162bab6aec618c554d13 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8eda774e3d2311513a35c49d7cad5e05c5fd9e03
Merge: 9defd1e e58e5c9
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 13:19:53 2012 +0200

    Merge branch 'ng/cleanup-revamp' into ng/master
    
    * ng/cleanup-revamp:
      [ng] cleanup: merge '%compile_clean_files' in '%clean_files'
      [ng] clean: drop minor DOS-related cruft in libtool support
      [ng] cleanup: remove 'clean-hdr.am'
      [ng] check: keep cleaning of '.log' and '.trs' files near other rules
      [ng] cleanup: remove 'libtool.am'
      [ng] refactor: prefer '&file_contents' over '&file_contents_internals'
      [ng] cleanup: merge '%compile_clean_files' in '%clean_files'
      [ng] refactoring: no "cleaning" rules in compile.am
      [ng] clean: don't remove object files in '.' unconditionally
      [ng] cleanup: remove 'depend.am'
      [ng] refactoring: move definition of $(am__mv) in depend2.am
      [ng] automake: new global variable '%clean_dirs'
      [ng] clean: do not ignore errors while removing files
      [ng] clean: revamp recipes and APIs to extend cleaning rules
      [ng] clean: simplify cleaning of compiled objects
      [ng] deptrack: clean depdirs using *clean-am targets
      [ng] deptrack: remove an obsolete comment

commit 9defd1ee421a319c9e19f4c5e47da534067b0aea
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 13:05:00 2012 +0200

    [ng] missing: no need to suggest GNU make explicitly
    
    * lib/missing (give_advice): Here.  In mainstream Automake, possible use
    of GNU make was suggested as a remedy against useless remake of '.info'
    files triggered by some buggy vendor make implementations.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 918c16551aa842a6a601dddf27672374b9e2c7d6
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 12:59:18 2012 +0200

    [ng] missing: suggest Automake-NG, not mainstream Automake
    
    * lib/missing (program_details): Here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit f855e98b434d74489e19aded9b598e6969068975
Merge: 20cff0b ebc92e1
Author: Stefano Lattarini <address@hidden>
Date:   Wed Jun 27 12:55:59 2012 +0200

    Merge branch 'master' into ng/master
    
    * master:
      missing: --run is supported again (as a no-op) for use by older automake
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit e58e5c97e1dabe42e8b2925b6b046887a56a8b6e
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 22:07:15 2012 +0200

    [ng] cleanup: merge '%compile_clean_files' in '%clean_files'
    
    No need to keep them separated anymore.
    
    * automake.in (%libtool_clean_directories): Delete.
    (initialize_per_input): Don't reset it.
    (handle_compile): Don't merge '%libtool_clean_directories' (after
    proper editing) into '%clean_dirs'.
    (handle_ltlibraries, handle_programs, handle_single_transform):
    Update '%clean_dirs', rather than '%libtool_clean_directories'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 041fe15b40fd0d28927b8b0d3ebe40f72f42de4e
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 21:49:50 2012 +0200

    [ng] clean: drop minor DOS-related cruft in libtool support
    
    * automake.in (handle_libtool): Do not bother cleaning '_libs'
    directories, they are only used by Libtool on MS-DOS (and we
    don't support that anymore).
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 0cf8c1b7ae1c45f286ab92c7769d9f3de6094cd5
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 21:26:17 2012 +0200

    [ng] cleanup: remove 'clean-hdr.am'
    
    It's so small and dumb that it's easier and cleaner to just inline
    it in the automake script.
    
    * lib/am/clean-hdr.am: Delete.
    * Makefile.am (dist_am_DATA): Remove it.
    * automake.in (handle_configure): Just add the header configs and their
    stamp files to '%clean_files', instead of processing the now-removed
    'clean-hdr.am' to obtain the same effect.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 244af89ee9da7b9224e1900d4be606f2e6d97757
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 12:27:06 2012 +0200

    [ng] check: keep cleaning of '.log' and '.trs' files near other rules
    
    * lib/am/parallel-tests.am: Add $(am__test_results), $(am__test_logs)
    and $(TEST_SUITE_LOGS) to the list of files removed by "make mostlyclean"
    here ...
    * automake.in (handle_tests): ... rather than here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 1f2a0986c1787568acefd00849ffb2d6d2f69c26
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 10:38:01 2012 +0200

    [ng] cleanup: remove 'libtool.am'
    
    It's so small and dumb that it's easier and cleaner to just inline
    it in the automake script.
    
    * lib/am/libtool.am: Delete.
    * Makefile.am (dist_am_DATA): Remove it.
    * automake.in (handle_libtool): Just add the list of all the '.libs'
    directories to '%libtool_clean_directories', instead of processing the
    now-removed 'libtool.am' to obtain the same effect.  Similarly, when
    processing the Makefile in the top-level directory, add 'libtool' and
    'config.lt' to '%clean_files'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit ec45429837a0fc2d74354cf92d5e9828563b15de
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 10:21:10 2012 +0200

    [ng] refactor: prefer '&file_contents' over '&file_contents_internals'
    
    No semantic change intended.
    
    * automake.in (handle_compile): Here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 2e51882b115a5e71e197c775135fcc36b1c048a9
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 09:51:35 2012 +0200

    [ng] cleanup: merge '%compile_clean_files' in '%clean_files'
    
    No need to keep them separated anymore.
    
    * automake.in (%compile_clean_files): Delete.
    (initialize_per_input): Don't reset it.
    (handle_compile): Don't merge '%compile_clean_files'
    contents into '%clean_files'.
    (handle_single_transform): Update '%clean_files', not
    '%compile_clean_files'.
    (handle_LIBOBJS_or_ALLOCA): Likewise.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit c66d183123ba0aaa8bd9e8750dbfbf1b99e39cf8
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 02:10:54 2012 +0200

    [ng] refactoring: no "cleaning" rules in compile.am
    
    * automake.in (handle_compile): To ensure the compiled objects are
    removed, simply merge the contents of '%compile_clean_files' into
    '%clean_files' here, instead of ...
    * lib/am/compile.am (am__mostlyclean_files): ... appending them to
    this variable here.  While we are at it, remove a stray declaration
    of the already-deleted target 'mostlyclean-compile' as ".PHONY".
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit c0e725abfcba609f0d962938e70f93daa62cdb83
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 02:01:11 2012 +0200

    [ng] clean: don't remove object files in '.' unconditionally
    
    Do that only if some source file is actually present in the current
    directory (which might not be the case for, say, projects that use
    a non-recursive make setup and have all sources in the 'src' and 'lib'
    subdirectories).
    
    * lib/am/compile.am (am__mostlyclean_files): Don't append '*.$(OBJEXT)'
    unconditionally.
    * lib/am/libtool.am (am__mostlyclean_files): Don't append '*.lo'
    unconditionally.
    * automake.in (handle_single_transform): Update '%compile_clean_files'
    also for sources in the current directory.  Some related adjustments.
    Remove obsolete comments while we are at it.
    (handle_LIBOBJS_or_ALLOCA): Update '%compile_clean_files' to list
    all the object files in the directory of the extra sources brought
    in.  Adjust comments accordingly.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 9d5c8e0e46e9e3650f67af20cb03174cd5773fae
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 01:38:50 2012 +0200

    [ng] cleanup: remove 'depend.am'
    
    It's so small and dumb that it's easier and cleaner to just inline
    it in the automake script.
    
    * lib/am/depend.am: Delete.
    * Makefile.am (dist_am_DATA): Remove it.
    * automake.in (handle_languages): Just add the list of all the '.deps'
    directories to %clean_dirs, instead of processing the now-removed
    'depend.am' to obtain the same effect.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit be756642bf96bffcd70a92af37caa398f1e82c57
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 01:27:15 2012 +0200

    [ng] refactoring: move definition of $(am__mv) in depend2.am
    
    A tiny refactoring only needed by the subsequent change.
    
    * lib/am/depend.am (am__mv): Move definition ...
    * lib/am/depend2.am [%?FIRST%]: ... here, with a new explicative
    comment.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 931cdfb8953d6ad0f4e3023bf7a870955c04d0ac
Author: Stefano Lattarini <address@hidden>
Date:   Thu Jun 21 01:10:14 2012 +0200

    [ng] automake: new global variable '%clean_dirs'
    
    Similar to the '%clean_files' variable, but it will allow us to declare
    directories (rather than regular files) that are to be cleaned by the
    four flavours of cleaning targets ('mostlyclean', 'clean', 'distclean',
    'maintainer-clean').  This will be especially useful in later changes.
    
    * automake.in (%clean_dirs): New global.
    (initialize_per_input): Reset it.
    * automake.in (handle_clean), lib/am/clean.am: Extend to clean the
    directories registered in '%clean_dirs'.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 6c5d0d3a8b805f8e4fa9808ed75722e654bfae87
Author: Stefano Lattarini <address@hidden>
Date:   Sat Jun 2 15:36:55 2012 +0200

    [ng] clean: do not ignore errors while removing files
    
    Possible culprits have been identified with the command "git grep '-rm\b'".
    
    * NG-NEWS: Update.
    * lib/am/tags.am, lib/am/distdir.am, lib/am/dejagnu.am, lib/am/clean.am: Do
    not prefix recipes invoking "rm" with the "-" recipe modifier: we now want
    the cleaning recipes to fail if rm encounters an error.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 1ec288788159d18f4a5d5f705072f4fded4629e0
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 19:23:46 2012 +0200

    [ng] clean: revamp recipes and APIs to extend cleaning rules
    
    This change it introduces eight new internal variables, which all
    can been appended to by our Makefile fragments to declare stuff that
    should be cleaned upon the various "make *clean" targets; these new
    variables are:
    
      - am__mostlyclean_files, am__mostlyclean_dirs
      - am__clean_files,       am__clean_dirs
      - am__distclean_files,   am__distclean_dirs
      - am__maintclean_files,  am__maintclean_dirs
    
    This change also ensures that the contents of the $(MOSTLYCLEANFILES),
    $(CLEANFILES), $(DISTCLEANFILES) and $(MAINTAINERCLEANFILES) variables
    will be cleaned even if those variables were not defined in the
    Makefile.am (so that it is now possible to, e.g., define them in a
    wrapper GNUmakefile including the Automake-generated Makefile, and
    still have the relevant '*clean' targets remove them).
    
    * am/clean.am (distclean): Revamp to implement the new API.
    * lib/am/compile.am, lib/am/configure.am, lib/am/dejagnu.am,
    lib/am/depend.am, lib/am/clean-hdr.am, lib/am/java.am, lib/am/libs.am,
    lib/am/libtool.am, lib/am/lisp.am, lib/am/ltlib.am, lib/am/progs.am,
    lib/am/tags.am, lib/am/texi-vers.am, lib/am/texinfos.am: Where possible
    and easy, adjust to append to those variables instead of tweaking
    or extending the various '*clean' or '*clean-am' targets or their
    dependencies.
    * automake.in (handle_compile, handle_libtool, handle_clean): Adjust.
    * t/cleanvars.sh: New test.
    * t/libtoo10.sh: Extend.
    * t/libtool.sh, t/libtool2.sh: Remove as obsolete.
    * syntax-checks.am: Extend to catch possible typos in the use of
    the new variables (for example, it is easy to erroneously write
    'am__cleanfiles' instead of 'am__clean_files').
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 1202aff29bb3fe8428cc32b079c3cc79d8130bfd
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 18:57:18 2012 +0200

    [ng] clean: simplify cleaning of compiled objects
    
    * automake.in (handle_compile): Compiled objects are always to be
    removed upon "make mostlyclean", never requiring a much stronger
    "make distclean" to be cleaned.  Simplify accordingly.
    * am/compile.am: Simplify accordingly, and do not bother cleaning
    '*.tab.c' files, that shouldn't be left behind by Automake-generated
    Makefiles anyway.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 2e757c6261fe69fc83efba6b6ca89b2ad0b89d87
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 16:35:34 2012 +0200

    [ng] deptrack: clean depdirs using *clean-am targets
    
    * lib/am/depend.am (am--clean-depdirs): New target, removing the
    $(DEPDIR) directory.
    (distclean, maintainer-clean): Renamed ...
    (distclean-am, maintainer-clean-am): ... to these, and depend on the new
    target above to clean the $(DEPDIR) directory.  Given the current status
    of the Automake internals, this shouldn't cause any change in the automake
    behaviour, but the new form of these declarations will be useful in future
    refactorings.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit f2c84c39cb94151701c0c430a35299a6c47d6043
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 30 16:24:59 2012 +0200

    [ng] deptrack: remove an obsolete comment
    
    * lib/am/depend.am: Since in Automake-NG the generated Makefile calls
    '-include' (not 'include') on the dependency tracking '.Po' files, 'make'
    will never fail simply because a '.Po' file is not found.  Remove a
    comment regarding the now-impossible include failure.
    
    Co-authored-by: Dave Hart <address@hidden>
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am              |    3 -
 NG-NEWS                  |    3 +
 automake.in              |  225 ++++++++++++++--------------------------------
 lib/am/clean-hdr.am      |   20 ----
 lib/am/clean.am          |   72 ++++++++++-----
 lib/am/compile.am        |   12 ---
 lib/am/configure.am      |   22 +++---
 lib/am/dejagnu.am        |   15 ++--
 lib/am/depend.am         |   27 ------
 lib/am/depend2.am        |    2 +
 lib/am/distdir.am        |    2 +-
 lib/am/java.am           |    8 +-
 lib/am/libs.am           |    4 +-
 lib/am/libtool.am        |   28 ------
 lib/am/lisp.am           |    5 +-
 lib/am/ltlib.am          |   13 +---
 lib/am/parallel-tests.am |    4 +
 lib/am/progs.am          |   13 +---
 lib/am/tags.am           |    9 +--
 lib/am/texi-vers.am      |   11 +--
 lib/am/texinfos.am       |   36 ++------
 lib/missing              |   16 ++--
 syntax-checks.mk         |   43 +++++++++
 t/cleanvars.sh           |  100 ++++++++++++++++++++
 t/libtoo10.sh            |   18 ++++
 t/libtool.sh             |   41 ---------
 t/libtool2.sh            |   49 ----------
 27 files changed, 336 insertions(+), 465 deletions(-)
 delete mode 100644 lib/am/clean-hdr.am
 delete mode 100644 lib/am/depend.am
 delete mode 100644 lib/am/libtool.am
 create mode 100755 t/cleanvars.sh
 delete mode 100755 t/libtool.sh
 delete mode 100755 t/libtool2.sh

diff --git a/Makefile.am b/Makefile.am
index a986f3b..b3ea89f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -192,13 +192,11 @@ dist_am_DATA = \
   lib/am/parallel-tests.am \
   lib/am/check-typos.am \
   lib/am/color-tests.am \
-  lib/am/clean-hdr.am \
   lib/am/clean.am \
   lib/am/compile.am \
   lib/am/configure.am \
   lib/am/data.am \
   lib/am/dejagnu.am \
-  lib/am/depend.am \
   lib/am/depend2.am \
   lib/am/distdir.am \
   lib/am/footer.am \
@@ -211,7 +209,6 @@ dist_am_DATA = \
   lib/am/lex.am \
   lib/am/library.am \
   lib/am/libs.am \
-  lib/am/libtool.am \
   lib/am/lisp.am \
   lib/am/ltlib.am \
   lib/am/ltlibrary.am \
diff --git a/NG-NEWS b/NG-NEWS
index 0e42863..8e77df7 100644
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -383,6 +383,9 @@ Miscellaneous
   has been renamed to AM_DEFAULT_INCLUDES, to avoid impinging on the user's
   namespace.  Do not override this variable in your Makefiles!
 
+* The Automake-generated clean targets do not exit successfully anymore if
+  an error occurs while removing a file or directory.
+
 -----
 
 Copyright (C) 2012 Free Software Foundation, Inc.
diff --git a/automake.in b/automake.in
index 6932bf5..074abf6 100644
--- a/automake.in
+++ b/automake.in
@@ -525,20 +525,10 @@ my @all;
 my @check;
 my @check_tests;
 
-# Keys in this hash table are files to delete.  The associated
-# value tells when this should happen (MOSTLY_CLEAN, DIST_CLEAN, etc.)
-my %clean_files;
-
-# Keys in this hash table are object files or other files in
-# subdirectories which need to be removed.  This only holds files
-# which are created by compilations.  The value in the hash indicates
-# when the file should be removed.
-my %compile_clean_files;
-
-# Keys in this hash table are directories where we expect to build a
-# libtool object.  We use this information to decide what directories
-# to delete.
-my %libtool_clean_directories;
+# Keys in this hash table are files and directories to delete.  The
+# associated value tells when this should happen (MOSTLY_CLEAN,
+# DIST_CLEAN, etc).
+my (%clean_files, %clean_dirs);
 
 # Value of $(SOURCES), used by tags.am.
 my @sources;
@@ -655,10 +645,7 @@ sub initialize_per_input ()
     @check_tests = ();
 
     %clean_files = ();
-    %compile_clean_files = ();
-
-    # We always include '.'.  This isn't strictly correct.
-    %libtool_clean_directories = ('.' => 1);
+    %clean_dirs = ();
 
     @sources = ();
     @dist_sources = ();
@@ -1307,16 +1294,11 @@ sub handle_languages
            # variable expansion; generating many separate includes
            # seems safest.
            $output_rules .= "\n";
-           foreach my $iter (@deplist)
+           foreach my $depfile (@deplist)
            {
-               $output_rules .= subst ('AMDEP_TRUE') . "-include $iter\n";
+               $output_rules .= subst ('AMDEP_TRUE') . "-include $depfile\n";
+               $clean_dirs{dirname ($depfile)} = DIST_CLEAN;
            }
-
-           # Compute the set of directories to remove in distclean-depend.
-           my @depdirs = uniq (map { dirname ($_) } @deplist);
-           $output_rules .= &file_contents ('depend',
-                                            new Automake::Location,
-                                            DEPDIRS => "@depdirs");
        }
     }
     else
@@ -1841,43 +1823,33 @@ sub handle_single_transform ($$$$$%)
        $linkers_used{$linker} = 1;
 
        push (@result, $object);
+        $directory = '.' if $directory eq '';
 
        if (! defined $object_map{$object})
-       {
+         {
            $object_map{$object} = $full;
 
-           # If resulting object is in subdir, we need to make
-           # sure the subdir exists at build time.
-           if ($object =~ /\//)
-           {
-               # FIXME: check that $DIRECTORY is somewhere in the
-               # project
-
-               # For Java, the way we're handling it right now, a
-               # '..' component doesn't make sense.
-               if ($lang && $lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
-                 {
-                   err_am "'$full' should not contain a '..' component";
-                 }
-
-                # Make sure *all* objects files in the subdirectory are
-                # removed by "make mostlyclean".  Not only this is more
-                # efficient than listing the object files to be removed
-                # individually (which would cause an 'rm' invocation for
-                # each of them -- very inefficient, see bug#10697), it
-                # would also leave stale object files in the subdirectory
-                # whenever a source file there is removed or renamed.
-                $compile_clean_files{"$directory/*.\$(OBJEXT)"} = MOSTLY_CLEAN;
-                if ($object =~ /\.lo$/)
-                  {
-                    # If we have a libtool object, then we also must remove
-                    # any '.lo' objects in its same subdirectory.
-                    $compile_clean_files{"$directory/*.lo"} = MOSTLY_CLEAN;
-                    # Remember to cleanup .libs/ in this directory.
-                    $libtool_clean_directories{$directory} = 1;
-                  }
-           }
-       }
+            # For Java, the way we're handling it right now, a
+            # '..' component doesn't make sense.
+            err_am "'$full' should not contain a '..' component"
+              if $lang && $lang->name eq 'java' && $object =~ m{(/|^)\.\./};
+
+            # Make sure *all* object files in this object's subdirectory
+            # are removed by "make mostlyclean".  Not only this is more
+            # efficient than listing the object files to be removed
+            # individually (which would cause an 'rm' invocation for each
+            # of them -- very inefficient, see bug#10697), it would also
+            # leave stale object files in the subdirectory whenever a
+            # source file there is removed or renamed.
+            $clean_files{"$directory/*.\$(OBJEXT)"} = MOSTLY_CLEAN;
+            if ($object =~ /\.lo$/)
+              {
+                # If we have a libtool object, then we also must remove
+                # any '.lo' objects in the same subdirectory.
+                $clean_files{"$directory/*.lo"} = MOSTLY_CLEAN;
+                $clean_dirs{"$directory/.libs"} = CLEAN;
+              }
+         }
 
        # Transform .o or $o file into .P file (for automatic
        # dependency code).
@@ -2128,11 +2100,8 @@ sub handle_LIBOBJS_or_ALLOCA ($)
   my $dir = '';
 
   # If LIBOBJS files must be built in another directory we have
-  # to define LIBOBJDIR and ensure the files get cleaned.
-  # Otherwise LIBOBJDIR can be left undefined, and the cleaning
-  # is achieved by 'rm -f *.$(OBJEXT)' in compile.am.
-  if ($config_libobj_dir
-      && $relative_dir ne $config_libobj_dir)
+  # to define the 'LIBOBJDIR' make variable.
+  if ($config_libobj_dir && $relative_dir ne $config_libobj_dir)
     {
       # In the top-level Makefile we do not use $(top_builddir), because
       # we are already there, and since the targets are built without
@@ -2141,11 +2110,10 @@ sub handle_LIBOBJS_or_ALLOCA ($)
       $dir = "$config_libobj_dir/" if $config_libobj_dir ne '.';
       $dir = "$topsrcdir/$dir" if $relative_dir ne '.';
       define_variable ('LIBOBJDIR', INTERNAL, $dir);
-      $clean_files{"\$($var)"} = MOSTLY_CLEAN;
-      # If LTLIBOBJS is used, we must also clear LIBOBJS (which might
-      # be created by libtool as a side-effect of creating LTLIBOBJS).
-      $clean_files{"\$($var)"} = MOSTLY_CLEAN if $var =~ s/^LT//;
     }
+  $clean_files{'$(LIBOBJDIR)*.$(OBJEXT)'} = MOSTLY_CLEAN;
+  $clean_files{'$(LIBOBJDIR)*.lo'} = MOSTLY_CLEAN
+    if $var =~ /^LT/;
 
   return $dir;
 }
@@ -2236,32 +2204,9 @@ sub check_canonical_spelling
 sub handle_compile ()
 {
    return if ! $must_handle_compiled_objects;
-
-    my (@mostly_rms, @dist_rms);
-    foreach my $item (sort keys %compile_clean_files)
-    {
-       if ($compile_clean_files{$item} == MOSTLY_CLEAN)
-       {
-           push (@mostly_rms, "\t-rm -f $item");
-       }
-       elsif ($compile_clean_files{$item} == DIST_CLEAN)
-       {
-           push (@dist_rms, "\t-rm -f $item");
-       }
-       else
-       {
-         prog_error 'invalid entry in %compile_clean_files';
-       }
-    }
-
-    my ($coms, $vars, $rules) =
-      &file_contents_internal (1, "$libdir/am/compile.am",
-                              new Automake::Location,
-                              ('STDINC' => ! option 'nostdinc',
-                               'MOSTLYRMS' => join ("\n", @mostly_rms),
-                               'DISTRMS' => join ("\n", @dist_rms)));
-    $output_vars .= $vars;
-    $output_rules .= "$coms$rules";
+   $output_rules .= file_contents ('compile',
+                                   new Automake::Location,
+                                   'STDINC' => ! option 'nostdinc');
 }
 
 # handle_libtool ()
@@ -2277,20 +2222,13 @@ sub handle_libtool
   require_conf_file_with_macro (TRUE, 'LIBTOOL', FOREIGN, @libtool_files)
     if $relative_dir eq '.' && ! $libtool_new_api;
 
-  my @libtool_rms;
-  foreach my $item (sort keys %libtool_clean_directories)
-    {
-      my $dir = ($item eq '.') ? '' : "$item/";
-      # .libs is for Unix, _libs for DOS.
-      push (@libtool_rms, "\t-rm -rf ${dir}.libs ${dir}_libs");
-    }
-
   check_user_variables 'LIBTOOLFLAGS';
 
-  # Output the libtool compilation rules.
-  $output_rules .= &file_contents ('libtool',
-                                  new Automake::Location,
-                                  LTRMS => join ("\n", @libtool_rms));
+  if ($relative_dir eq '.')
+    {
+      $clean_files{"libtool"} = DIST_CLEAN;
+      $clean_files{"config.lt"} = DIST_CLEAN;
+    }
 }
 
 # handle_programs ()
@@ -2353,7 +2291,7 @@ sub handle_programs
       my($xlink, $vlink) = &define_per_target_linker_variable ($linker, 
$xname);
       $vlink = verbose_flag ($vlink || 'GEN');
 
-      $libtool_clean_directories{dirname ($one_file)} = 1;
+      $clean_dirs{dirname ($one_file) . '/.libs'} = CLEAN;
 
       $output_rules .= &file_contents ('program',
                                       $where,
@@ -2691,9 +2629,7 @@ sub handle_ltlibraries
            }
        }
 
-      # Remember to cleanup .libs/ in this directory.
-      my $dirname = dirname $onelib;
-      $libtool_clean_directories{$dirname} = 1;
+      $clean_dirs{dirname ($onelib) . '/.libs'} = CLEAN;
 
       $output_rules .= &file_contents ('ltlibrary',
                                       $where,
@@ -3703,7 +3639,6 @@ sub handle_configure ($$$@)
 
   # If we have a configure header, require it.
   my $hdr_index = 0;
-  my @distclean_config;
   foreach my $spec (@config_headers)
     {
       $hdr_index += 1;
@@ -3753,15 +3688,11 @@ sub handle_configure ($$$@)
                           CONFIG_H_PATH    => $config_h_path,
                           STAMP            => "$stamp");
 
-         push @distclean_config, $cn_sans_dir, $stamp;
+           $clean_files{$cn_sans_dir} = DIST_CLEAN;
+           $clean_files{$stamp} = DIST_CLEAN;
        }
     }
 
-  $output_rules .= file_contents ('clean-hdr',
-                                 new Automake::Location,
-                                 FILES => "@distclean_config")
-    if @distclean_config;
-
   my @config_h;
   foreach my $spec (@config_headers)
     {
@@ -4026,49 +3957,30 @@ sub handle_clean ($)
 {
   my ($makefile) = @_;
 
-  # Clean the files listed in user variables if they exist.
-  $clean_files{'$(MOSTLYCLEANFILES)'} = MOSTLY_CLEAN
-    if var ('MOSTLYCLEANFILES');
-  $clean_files{'$(CLEANFILES)'} = CLEAN
-    if var ('CLEANFILES');
-  $clean_files{'$(DISTCLEANFILES)'} = DIST_CLEAN
-    if var ('DISTCLEANFILES');
-  $clean_files{'$(MAINTAINERCLEANFILES)'} = MAINTAINER_CLEAN
-    if var ('MAINTAINERCLEANFILES');
-
-  # Built sources are automatically removed by maintainer-clean.
-  $clean_files{'$(BUILT_SOURCES)'} = MAINTAINER_CLEAN
-    if var ('BUILT_SOURCES');
-
-  # Compute a list of "rm"s to run for each target.
-  my %rms = (MOSTLY_CLEAN, [],
-            CLEAN, [],
-            DIST_CLEAN, [],
-            MAINTAINER_CLEAN, []);
+  my @fkeys = keys %clean_files;
+  my @fmostly = grep { $clean_files{$_} == MOSTLY_CLEAN     } @fkeys;
+  my @fplain  = grep { $clean_files{$_} == CLEAN            } @fkeys;
+  my @fdist   = grep { $clean_files{$_} == DIST_CLEAN       } @fkeys;
+  my @fmaint  = grep { $clean_files{$_} == MAINTAINER_CLEAN } @fkeys;
 
-  foreach my $file (keys %clean_files)
-    {
-      my $when = $clean_files{$file};
-      prog_error 'invalid entry in %clean_files'
-       unless exists $rms{$when};
-
-      my $rm = "rm -f $file";
-      # If file is a variable, make sure when don't call 'rm -f' without args.
-      $rm ="test -z \"$file\" || $rm"
-       if ($file =~ /^\s*\$(\(.*\)|\{.*\})\s*$/);
-
-      push @{$rms{$when}}, "\t-$rm\n";
-    }
+  my @dkeys = keys %clean_dirs;
+  my @dmostly = grep { $clean_dirs{$_} == MOSTLY_CLEAN     } @dkeys;
+  my @dplain  = grep { $clean_dirs{$_} == CLEAN            } @dkeys;
+  my @ddist   = grep { $clean_dirs{$_} == DIST_CLEAN       } @dkeys;
+  my @dmaint  = grep { $clean_dirs{$_} == MAINTAINER_CLEAN } @dkeys;
 
   $output_rules .= &file_contents
     ('clean',
      new Automake::Location,
-     MOSTLYCLEAN_RMS      => join ('', sort @{$rms{&MOSTLY_CLEAN}}),
-     CLEAN_RMS            => join ('', sort @{$rms{&CLEAN}}),
-     DISTCLEAN_RMS        => join ('', sort @{$rms{&DIST_CLEAN}}),
-     MAINTAINER_CLEAN_RMS => join ('', sort @{$rms{&MAINTAINER_CLEAN}}),
-     MAKEFILE             => basename $makefile,
-     );
+     'MOSTLYCLEAN-FILES'     => "@fmostly",
+     'CLEAN-FILES'           => "@fplain",
+     'DISTCLEAN-FILES'       => "@fdist",
+     'MAINTAINERCLEAN-FILES' => "@fmaint",
+     'MOSTLYCLEAN-DIRS'      => "@dmostly",
+     'CLEAN-DIRS'            => "@dplain",
+     'DISTCLEAN-DIRS'        => "@ddist",
+     'MAINTAINERCLEAN-DIRS'  => "@dmaint",
+     'MAKEFILE'              => basename $makefile);
 }
 
 
@@ -4220,9 +4132,6 @@ sub handle_tests
             file_contents ('parallel-tests', new Automake::Location,
                            COLOR => !! option 'color-tests',
                            CHECK_DEPS => "@check");
-         $clean_files{'$(am__test_logs)'} = MOSTLY_CLEAN;
-         $clean_files{'$(am__test_results)'} = MOSTLY_CLEAN;
-         $clean_files{'$(TEST_SUITE_LOG)'} = MOSTLY_CLEAN;
        }
     }
 }
diff --git a/lib/am/clean-hdr.am b/lib/am/clean-hdr.am
deleted file mode 100644
index 3f377c8..0000000
--- a/lib/am/clean-hdr.am
+++ /dev/null
@@ -1,20 +0,0 @@
-## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994-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/>.
-
-.PHONY: distclean-hdr
-distclean-am: distclean-hdr
-distclean-hdr:
-       -rm -f %FILES%
diff --git a/lib/am/clean.am b/lib/am/clean.am
index da46435..d05cd66 100644
--- a/lib/am/clean.am
+++ b/lib/am/clean.am
@@ -14,44 +14,66 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## We must test each macro because it might be empty, and an empty "rm
-## -rf" command looks disturbing.  Also, the Solaris 2.4 "rm" will
-## return an error if there are no arguments other than "-f".
+.am.clean-cmd.f = $(if $(strip $1),rm -f $(strip $1))
+.am.clean-cmd.d = $(if $(strip $1),rm -rf $(strip $1))
+
+am__mostlyclean_files += $(MOSTLYCLEANFILES)
+am__clean_files       += $(CLEANFILES)
+am__distclean_files   += $(DISTCLEANFILES)
+am__maintclean_files  += $(MAINTAINERCLEANFILES)
+
+am__mostlyclean_files += %MOSTLYCLEAN-FILES%
+am__clean_files       += %CLEAN-FILES%
+am__distclean_files   += %DISTCLEAN-FILES%
+am__maintclean_files  += %MAINTAINERCLEAN-FILES%
+
+am__mostlyclean_dirs  += %MOSTLYCLEAN-DIRS%
+am__clean_dirs        += %CLEAN-DIRS%
+am__distclean_dirs    += %DISTCLEAN-DIRS%
+am__maintclean_dirs   += %MAINTAINERCLEAN-DIRS%
+
+am__distclean_files += $(CONFIG_CLEAN_FILES)
+## Some files must be cleaned only in VPATH builds -- e.g., those linked
+## in usages like "AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])".
+am__distclean_files += $(if $(filter .,$(srcdir)),,$(CONFIG_CLEAN_VPATH_FILES))
+
+## Built sources are automatically removed by maintainer-clean.
+## This is what mainline Automake does.
+am__maintclean_files += $(BUILT_SOURCES)
+
+## FIXME: These might cause command line length limits to be exceeded;
+## FIXME: we should break them on multiple invocations when there are
+## FIXME: too many files.
+
 mostlyclean-am: mostlyclean-generic
 mostlyclean-generic:
-%MOSTLYCLEAN_RMS%
+       $(call .am.clean-cmd.f,$(am__mostlyclean_files))
+       $(call .am.clean-cmd.d,$(am__mostlyclean_dirs))
 
 clean-am: clean-generic mostlyclean-am
 clean-generic:
-%CLEAN_RMS%
+       $(call .am.clean-cmd.f,$(am__clean_files))
+       $(call .am.clean-cmd.d,$(am__clean_dirs))
 
 distclean-am: distclean-generic clean-am
 distclean-generic:
-       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f 
$(CONFIG_CLEAN_VPATH_FILES)
-%DISTCLEAN_RMS%
-
-## Makefiles and their dependencies cannot be cleaned by
-## an -am dependency, because that would prevent other distclean
-## dependencies from calling make recursively.  (The multilib
-## cleaning rules do this.)
-##
-## If you change distclean here, you probably also want to change
-## maintainer-clean below.
-distclean:
-       -rm -f %MAKEFILE%
+       $(call .am.clean-cmd.f,$(am__distclean_files))
+       $(call .am.clean-cmd.d,$(am__distclean_dirs))
 
 maintainer-clean-am: maintainer-clean-generic distclean-am
 maintainer-clean-generic:
-## FIXME: shouldn't we really print these messages before running
-## the dependencies?
-       @echo "This command is intended for maintainers to use"
-       @echo "it deletes files that may require special tools to rebuild."
-%MAINTAINER_CLEAN_RMS%
+       $(call .am.clean-cmd.f,$(am__maintclean_files))
+       $(call .am.clean-cmd.d,$(am__maintclean_dirs))
 
-## See comment for distclean.
+## Makefiles and their dependencies cannot be cleaned by
+## an '-am' dependency, because that would prevent other distclean
+## dependencies from calling make recursively (the multilib cleaning
+## used to do this, and it's not unreasonable to expect user-defined
+## rules might do that as well).
+distclean:
+       rm -f %MAKEFILE% $(am__config_distclean_files)
 maintainer-clean:
-       -rm -f %MAKEFILE%
+       rm -f %MAKEFILE% $(am__config_distclean_files)
 
 .PHONY: clean mostlyclean distclean maintainer-clean \
 clean-generic mostlyclean-generic distclean-generic maintainer-clean-generic
diff --git a/lib/am/compile.am b/lib/am/compile.am
index 3be6f7d..ceb5c9d 100644
--- a/lib/am/compile.am
+++ b/lib/am/compile.am
@@ -26,15 +26,3 @@ AM_DEFAULT_INCLUDES = \
 else !%?STDINC%
 AM_DEFAULT_INCLUDES =
 endif !%?STDINC%
-
-mostlyclean-am: mostlyclean-compile
-mostlyclean-compile:
-       -rm -f *.$(OBJEXT)
-?MOSTLYRMS?%MOSTLYRMS%
-
-distclean-am: distclean-compile
-distclean-compile:
-       -rm -f *.tab.c
-?DISTRMS?%DISTRMS%
-
-.PHONY: mostlyclean-compile distclean-compile
diff --git a/lib/am/configure.am b/lib/am/configure.am
index f9d604a..7024e7b 100644
--- a/lib/am/configure.am
+++ b/lib/am/configure.am
@@ -136,23 +136,23 @@ endif %?REGEN-ACLOCAL-M4%
 ## Makefile depends on config.status.
 
 if %?TOPDIR_P%
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-distclean:
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
 
-## Note: you might think we should remove Makefile.in, configure, or
-## aclocal.m4 here in a maintainer-clean rule.  However, the GNU
-## Coding Standards explicitly prohibit this.
+## This variable is used in 'clean.am'.  See the comments to the
+## 'distclean' and 'maintainer-clean' targets there to understand
+## why we cannot simply append this to $(am__distclean_files) or
+## $(am__maintclean_files).
+am__config_distclean_files = \
+  config.status \
+  config.cache \
+  config.log \
+  configure.lineno \
+  config.status.lineno
 
-maintainer-clean:
-       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
 ## autom4te.cache is created by Autoconf; the only valid target to
 ## remove it is maintainer-clean, not distclean.
 ## If you have an autom4te.cache that cause distcheck to fail, then
 ## it is good news: you finally discovered that autoconf and/or
 ## autoheader is needed to use your tarball, which is wrong.
-       -rm -rf $(top_srcdir)/autom4te.cache
-
+am__maintclean_dirs += $(top_srcdir)/autom4te.cache
 
 endif %?TOPDIR_P%
diff --git a/lib/am/dejagnu.am b/lib/am/dejagnu.am
index 50c1f51..cb88949 100644
--- a/lib/am/dejagnu.am
+++ b/lib/am/dejagnu.am
@@ -73,7 +73,7 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
        @if test -f site.exp; then \
           sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> 
site.tmp; \
         fi
-       @-rm -f site.bak
+       @rm -f site.bak
        @test ! -f site.exp || mv site.exp site.bak
        @mv site.tmp site.exp
 
@@ -81,13 +81,12 @@ site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY distclean-am: distclean-DEJAGNU
-
-distclean-DEJAGNU:
 ## Any other cleaning must be done by the user or by the test suite
 ## itself.  We can't predict what dejagnu or the test suite might
 ## generate.
-       -rm -f site.exp site.bak
-       -l='$(DEJATOOL)'; for tool in $$l; do \
-         rm -f $$tool.sum $$tool.log; \
-       done
+## FIXME: we clean these on "make distclean" only for better compatibility
+## FIXME: with mainline Automake, but wouldn't be more correct to clean
+## FIXME: them on "make clean" instead?
+am__distclean_files += site.exp site.bak
+am__distclean_files += $(addsuffix .sum,$(DEJATOOL))
+am__distclean_files += $(addsuffix .log,$(DEJATOOL))
diff --git a/lib/am/depend.am b/lib/am/depend.am
deleted file mode 100644
index 643c6ab..0000000
--- a/lib/am/depend.am
+++ /dev/null
@@ -1,27 +0,0 @@
-## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994-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/>.
-
-am__mv = mv -f
-
-## This Makefile depends on Depdirs' files, so we should never
-## erase them in -am or -recursive rules; that would prevent any other
-## rules from being recursive (for instance multilib clean rules are
-## recursive).
-distclean:
-       -rm -rf %DEPDIRS%
-
-maintainer-clean:
-       -rm -rf %DEPDIRS%
diff --git a/lib/am/depend2.am b/lib/am/depend2.am
index 38f30bf..2601434 100644
--- a/lib/am/depend2.am
+++ b/lib/am/depend2.am
@@ -39,6 +39,8 @@ am__depbase = $(am__depdir)/$(basename $(notdir $@))
 ## Avoid useless forks when possible.
 am__ensure_depdir = $(call am__ensure_dir_exists,$(am__depdir))
 am__o_src = $(if $(filter .obj,$(suffix $@)),`$(CYGPATH_W) $<`,$<)
+## To facilitate use of "libtool --dry-run".
+am__mv = mv -f
 endif %?FIRST%
 
 if %?NONLIBTOOL%
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 69c5520..baa7325 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -337,7 +337,7 @@ dist-shar: distdir
 ?ZIP?DIST_ARCHIVES += $(distdir).zip
 .PHONY: dist-zip
 dist-zip: distdir
-       -rm -f $(distdir).zip
+       rm -f $(distdir).zip
        zip -rq $(distdir).zip $(distdir)
        $(am__post_remove_distdir)
 
diff --git a/lib/am/java.am b/lib/am/java.am
index 289013c..7b52bdc 100644
--- a/lib/am/java.am
+++ b/lib/am/java.am
@@ -78,9 +78,11 @@ endif %?INSTALL%
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY clean-am: clean-%NDIR%JAVA
-clean-%NDIR%JAVA:
-       -rm -f *.class class%NDIR%.stamp
+## Do not repeat the *.class wildcard over and over.
+if %?FIRST%
+am__clean_files += *.class
+endif
+am__clean_files += class%NDIR%.stamp
 
 
 ## -------------- ##
diff --git a/lib/am/libs.am b/lib/am/libs.am
index f94a712..0e39fe9 100644
--- a/lib/am/libs.am
+++ b/lib/am/libs.am
@@ -101,6 +101,4 @@ endif %?INSTALL%
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY clean-am: clean-%DIR%LIBRARIES
-clean-%DIR%LIBRARIES:
-       -test -z "$(%DIR%_LIBRARIES)" || rm -f $(%DIR%_LIBRARIES)
+am__clean_files += $(%DIR%_LIBRARIES)
diff --git a/lib/am/libtool.am b/lib/am/libtool.am
deleted file mode 100644
index 3681c45..0000000
--- a/lib/am/libtool.am
+++ /dev/null
@@ -1,28 +0,0 @@
-## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994-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/>.
-
-.PHONY: mostlyclean-libtool clean-libtool distclean-libtool
-mostlyclean-am: mostlyclean-libtool
-mostlyclean-libtool:
-       -rm -f *.lo
-
-clean-am: clean-libtool
-clean-libtool:
-?LTRMS?%LTRMS%
-
-?TOPDIR_P?distclean-am: distclean-libtool
-?TOPDIR_P?distclean-libtool:
-?TOPDIR_P?     -rm -f libtool config.lt
diff --git a/lib/am/lisp.am b/lib/am/lisp.am
index 66b8cbc..81dc865 100644
--- a/lib/am/lisp.am
+++ b/lib/am/lisp.am
@@ -141,10 +141,7 @@ endif %?INSTALL%
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY clean-am: clean-lisp
-clean-lisp:
-       -rm -f elc-stamp $(ELCFILES)
-
+am__clean_files += elc-stamp $(ELCFILES)
 
 ## -------------- ##
 ## Distributing.  ##
diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am
index af3a256..00928f3 100644
--- a/lib/am/ltlib.am
+++ b/lib/am/ltlib.am
@@ -107,17 +107,8 @@ endif %?INSTALL%
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY clean-am: clean-%DIR%LTLIBRARIES
-clean-%DIR%LTLIBRARIES:
-       -test -z "$(%DIR%_LTLIBRARIES)" || rm -f $(%DIR%_LTLIBRARIES)
+am__clean_files += $(%DIR%_LTLIBRARIES)
 ## 'so_locations' files are created by some linkers (IRIX, OSF) when
 ## building a shared object.  Libtool places these files in the
 ## directory where the shared object is created.
-       @list='$(%DIR%_LTLIBRARIES)'; \
-       locs=`for p in $$list; do echo $$p; done | \
-             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
-             sort -u`; \
-       test -z "$$locs" || { \
-         echo rm -f $${locs}; \
-         rm -f $${locs}; \
-       }
+am__clean_files += $(wildcard $(addsuffix so_locations,$(sort $(dir 
$(%DIR%_LTLIBRARIES)))))
diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am
index d945d0b..c8913f6 100644
--- a/lib/am/parallel-tests.am
+++ b/lib/am/parallel-tests.am
@@ -256,6 +256,8 @@ am__test_results = \
 am__test_logs = \
   $(call am__memoize,am__test_logs,$(addsuffix .log,$(strip 
$(am__test_bases))))
 
+am__mostlyclean_files += $(am__test_results) $(am__test_logs)
+
 # $(TEST_LOGS) is a published interface.
 TEST_LOGS = $(am__test_logs)
 
@@ -377,6 +379,8 @@ $(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
        fi;                                                             \
        $$success || exit 1
 
+am__mostlyclean_files += $(TEST_SUITE_LOG)
+
 ## ------------------------------------------ ##
 ## Running all tests, or rechecking failures. ##
 ## ------------------------------------------ ##
diff --git a/lib/am/progs.am b/lib/am/progs.am
index 104270c..66ecc3d 100644
--- a/lib/am/progs.am
+++ b/lib/am/progs.am
@@ -103,9 +103,7 @@ endif %?INSTALL%
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY clean-am: clean-%DIR%PROGRAMS
-clean-%DIR%PROGRAMS:
-?!LIBTOOL?     -test -z "$(%DIR%_PROGRAMS)" || rm -f $(%DIR%_PROGRAMS)
+am__clean_files += $(%DIR%_PROGRAMS)
 ## Under Cygwin, we build 'program$(EXEEXT)'.  However, if this
 ## program uses a Libtool library, Libtool will move it in
 ## '_libs/program$(EXEEXT)' and create a 'program' wrapper (without
@@ -114,14 +112,7 @@ clean-%DIR%PROGRAMS:
 ## Cleaning the '_libs/' or '.libs/' directory is done from clean-libtool.
 ## FIXME: In the future (i.e., when it works) it would be nice to delegate
 ## this task to "libtool --mode=clean".
-?LIBTOOL?      @list='$(%DIR%_PROGRAMS)'; test -n "$$list" || exit 0; \
-?LIBTOOL?      echo " rm -f" $$list; \
-?LIBTOOL?      rm -f $$list || exit $$?; \
-?LIBTOOL?      test -n "$(EXEEXT)" || exit 0; \
-?LIBTOOL?      list=`for p in $$list; do echo "$$p"; done | sed 
's/$(EXEEXT)$$//'`; \
-?LIBTOOL?      echo " rm -f" $$list; \
-?LIBTOOL?      rm -f $$list
-
+?LIBTOOL?am__clean_files += $(if $(EXEEXT),$(patsubst 
%$(EXEEXT),%,$(%DIR%_PROGRAMS)))
 
 ## ---------- ##
 ## Checking.  ##
diff --git a/lib/am/tags.am b/lib/am/tags.am
index 11a786f..2abd563 100644
--- a/lib/am/tags.am
+++ b/lib/am/tags.am
@@ -144,7 +144,7 @@ cscope: cscope.files
          || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files 
$(CSCOPE_ARGS)
 
 clean-cscope:
-       -rm -f cscope.files
+       rm -f cscope.files
 
 cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
 
@@ -170,10 +170,7 @@ cscopelist: %CSCOPEDIRS% $(am__tagged_files)
 ## Cleaning.  ##
 ## ---------- ##
 
-.PHONY distclean-am: distclean-tags
-
-distclean-tags:
-       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+am__distclean_files += TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 if %?TOPDIR_P%
-       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+am__distclean_files += cscope.out cscope.in.out cscope.po.out cscope.files
 endif %?TOPDIR_P%
diff --git a/lib/am/texi-vers.am b/lib/am/texi-vers.am
index 2e6a147..4c13130 100644
--- a/lib/am/texi-vers.am
+++ b/lib/am/texi-vers.am
@@ -40,12 +40,5 @@ am__dist_common += %VTEXI% %STAMPVTI%
        fi;
        @cp %VTEXI% $@
 
-mostlyclean-am: mostlyclean-%VTI%
-mostlyclean-%VTI%:
-       -rm -f %VTI%.tmp
-
-maintainer-clean-am: maintainer-clean-%VTI%
-maintainer-clean-%VTI%:
-%MAINTAINER-MODE%      -rm -f %STAMPVTI% %VTEXI%
-
-.PHONY: mostlyclean-%VTI% maintainer-clean-%VTI%
+am__mostlyclean_files += %VTI%.tmp
+%MAINTAINER-MODE%am__maintclean_files += %STAMPVTI% %VTEXI%
diff --git a/lib/am/texinfos.am b/lib/am/texinfos.am
index 7393ec8..d8edfc8 100644
--- a/lib/am/texinfos.am
+++ b/lib/am/texinfos.am
@@ -298,34 +298,14 @@ endif %?LOCAL-TEXIS%
 ## Cleaning.  ##
 ## ---------- ##
 
-## The funny name is due to --cygnus influence; in Cygnus mode,
-## 'clean-info' is a target that users can use.
-
 if %?LOCAL-TEXIS%
-.PHONY mostlyclean-am: mostlyclean-aminfo
-.PHONY: mostlyclean-aminfo
-mostlyclean-aminfo:
-## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html", as well as the
-## '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
-       -rm -rf %MOSTLYCLEAN%
-
-.PHONY clean-am: clean-aminfo
-clean-aminfo:
-## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
-## above for details.
-?TEXICLEAN?    -test -z "%TEXICLEAN%" \
-?TEXICLEAN?    || rm -rf %TEXICLEAN%
-
-.PHONY maintainer-clean-am: maintainer-clean-aminfo
-maintainer-clean-aminfo:
-       @list='$(INFO_DEPS)'; for i in $$list; do \
-         echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
-         rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
-       done
-## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
-## above for details.
-?MAINTCLEAN?   -test -z "%MAINTCLEAN%" \
-?MAINTCLEAN?   || rm -rf %MAINTCLEAN%
+## Append to dirs, not files, because the %*CLEAN% substitutions can
+## also contain any directory created by "makeinfo --html", as well as
+## the '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
+am__mostlyclean_dirs += %MOSTLYCLEAN%
+am__clean_dirs += %TEXICLEAN%
+am__maintclean_dirs += %MAINTCLEAN%
+
+am__maintclean_files += $(foreach f,$(INFO_DEPS),$f $f-[0-9] $f-[0-9][0-9])
 
 endif %?LOCAL-TEXIS%
diff --git a/lib/missing b/lib/missing
index 4e083f9..cd1f739 100755
--- a/lib/missing
+++ b/lib/missing
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2012-06-25.10; # UTC
+scriptversion=2012-06-27.11; # UTC
 
 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <address@hidden>, 1996.
@@ -37,6 +37,11 @@ case $1 in
     exit 0
     ;;
 
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
   -h|--h|--he|--hel|--help)
     echo "\
 $0 [OPTION]... PROGRAM [ARGUMENT]...
@@ -104,8 +109,9 @@ program_details ()
 {
   case $1 in
     aclocal|automake)
-      echo "The '$1' program is part of the GNU Automake package:"
-      echo "<$gnu_software_URL/automake>"
+      echo "The '$1' program is part of the GNU Automake-NG package:"
+      # FIXME: maybe it's time for Automake-NG to have a page of its own?
+      echo "<https://lists.gnu.org/mailman/listinfo/automake-ng>"
       echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
       echo "<$gnu_software_URL/autoconf>"
       echo "<$gnu_software_URL/m4/>"
@@ -179,10 +185,6 @@ give_advice ()
       echo "any other file indirectly affecting the aspect of the manual."
       echo "You might want to install the Texinfo package:"
       echo "<$gnu_software_URL/texinfo/>"
-      echo "The spurious makeinfo call might also be the consequence of"
-      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
-      echo "want to install GNU make:"
-      echo "<$gnu_software_URL/make/>"
       ;;
     *)
       echo "You might have modified some files without having the proper"
diff --git a/syntax-checks.mk b/syntax-checks.mk
index 4c6698f..93d9a8a 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -63,6 +63,7 @@ sc_no_dotmake_target \
 sc_no_am_makeflags \
 $(sc_obsolete_requirements_rules) \
 $(sc_renamed_variables_rules) \
+$(sc_variable_typos_rules) \
 sc_no_RECHECK_LOGS \
 sc_tests_no_make_e \
 sc_docs_no_make_e \
@@ -341,6 +342,48 @@ $(sc_renamed_variables_rules): sc_no_% :
          exit 1; \
        fi
 
+# Variables whose name is prone to typos.
+fixtypo.am__distfiles = am__dist_files
+fixtypo.am__distcommon = am__dist_common
+fixtypo.am__distsources = am__dist_sources
+
+define typos-for-clean
+
+fixtypo.am__mostlyclean$1 = am__mostlyclean_$1
+fixtypo.am__clean$1 = am__clean_$1
+fixtypo.am__distclean$1 = am__distclean_$1
+fixtypo.am__maintclean$1 = am__maintclean_$1
+
+fixtypo.am__mostly_clean_$1 = am__mostlyclean_$1
+fixtypo.am__dist_clean_$1 = am__distclean_$1
+
+fixtypo.am__maint_clean_$1 = am__maintclean_$1
+fixtypo.am__maintainerclean_$1 = am__maintclean_$1
+fixtypo.am__maintainer_clean_$1 = am__maintclean_$1
+
+endef
+
+$(eval $(call typos-for-clean,files))
+$(eval $(call typos-for-clean,dirs))
+
+sc_variables_typos_rules = \
+  $(patsubst fixtypo.%,sc_no_%,$(filter fixtypo.%,$(.VARIABLES)))
+
+$(sc_variable_typos_rules) : sc_no_% :
+       @files="\
+         $(xtests) \
+         $(pms) \
+         $(ams) \
+         $(srcdir)/automake.in \
+         $(srcdir)/doc/*.texi \
+       "; \
+       if grep -E '\b$*\b' $$files; then \
+         echo "'\$$($*)' is probably a typo." >&2; \
+         echo "You should use '$(fixtypo.$*)' instead." >&2; \
+         exit 1; \
+       fi
+
+
 sc_no_RECHECK_LOGS:
        @files="\
          $(xtests) \
diff --git a/t/cleanvars.sh b/t/cleanvars.sh
new file mode 100755
index 0000000..2f14e17
--- /dev/null
+++ b/t/cleanvars.sh
@@ -0,0 +1,100 @@
+#! /bin/sh
+# Copyright (C) 2001-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/>.
+
+# Check support for:
+#   - MOSTLYCLEANFILES
+#   - CLEANFILES
+#   - DISTCLEANFILES
+#   - MAINTAINERCLEANFILES
+# Especially checks that it is possible to extend them also from a
+# "wrapper" makefile never processed nor seen by Automake.
+
+. ./defs || Exit 1
+
+echo AC_OUTPUT >> configure.ac
+
+setup () { touch mostly plain dist maint mostly2 plain2 dist2 maint2; }
+
+cat > Makefile.am << 'END'
+MOSTLYCLEANFILES = mostly
+CLEANFILES = plain
+DISTCLEANFILES = dist
+MAINTAINERCLEANFILES = maint
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+cat > GNUmakefile << 'END'
+include Makefile
+MOSTLYCLEANFILES += mostly2
+CLEANFILES += plain2
+DISTCLEANFILES += dist2
+MAINTAINERCLEANFILES += maint2
+END
+
+./configure
+cp config.status config.sav # Save for later.
+
+setup
+$MAKE mostlyclean
+test ! -f mostly
+test ! -f mostly2
+test -f plain
+test -f plain2
+test -f dist
+test -f dist2
+test -f maint
+test -f maint2
+
+setup
+$MAKE clean
+test ! -f mostly
+test ! -f mostly2
+test ! -f plain
+test ! -f plain2
+test -f dist
+test -f dist2
+test -f maint
+test -f maint2
+
+setup
+$MAKE distclean
+test ! -f mostly
+test ! -f mostly2
+test ! -f plain
+test ! -f plain2
+test ! -f dist
+test ! -f dist2
+test -f maint
+test -f maint2
+
+setup
+# The "make distclean" before has removed Makefile and config.status.
+mv config.sav config.status
+./config.status Makefile
+$MAKE maintainer-clean
+test ! -f mostly
+test ! -f mostly2
+test ! -f plain
+test ! -f plain2
+test ! -f dist
+test ! -f dist2
+test ! -f maint
+test ! -f maint2
+
+:
diff --git a/t/libtoo10.sh b/t/libtoo10.sh
index 0218ef3..07efaea 100755
--- a/t/libtoo10.sh
+++ b/t/libtoo10.sh
@@ -16,6 +16,10 @@
 
 # Make sure .libs directories are removed for _PROGRAMS.
 # Report from Guillermo Ontañón.
+# Also make sure the 'so_locations' files generated by some linkers
+# (OSF, IRIX) are removed.
+# And also make sure the generated 'libtool' script as well as the
+# *.lo files are removed when they should.
 
 required='cc libtoolize'
 . ./defs || Exit 1
@@ -52,9 +56,23 @@ $AUTOMAKE --add-missing
 $AUTOCONF
 ./configure
 $MAKE all check
+: > lib/so_locations
+: > src/so_locations
 $MAKE clean
+ls *.lo && Exit 1
+test -f libtool
 test ! -d src/.libs
 test ! -d src/_libs
 test ! -d check/.libs
 test ! -d check/_libs
+test -f src/so_locations
+test ! -f lib/so_locations
+# No libtool libraries created in this directory, our rules
+# shouldn't bother about possible linker files in it.
+test -f src/so_locations
 $MAKE distcheck
+
+$MAKE distclean
+test ! -f libtool
+
+:
diff --git a/t/libtool.sh b/t/libtool.sh
deleted file mode 100755
index 7b267a7..0000000
--- a/t/libtool.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-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/>.
-
-# Make sure libtool is removed.
-# Report from Kevin Dalley.
-
-required=libtool
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_LIBTOOL_DLOPEN
-AC_DISABLE_SHARED
-AC_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-END
-
-: > Makefile.am
-
-: > ltmain.sh
-: > config.guess
-: > config.sub
-
-$ACLOCAL
-$AUTOMAKE
-
-grep 'rm -f libtool' Makefile.in
-
-:
diff --git a/t/libtool2.sh b/t/libtool2.sh
deleted file mode 100755
index 3b8a78b..0000000
--- a/t/libtool2.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-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/>.
-
-# Make sure libtool clean targets exist.
-# Report from Eric Magnien.
-
-required=libtoolize
-. ./defs || Exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_AR
-AC_PROG_LIBTOOL
-AC_CONFIG_FILES([sub/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIR = subdir
-lib_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = foo.c
-END
-
-mkdir sub
-cat > sub/Makefile.am << 'END'
-lib_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = foo.c
-END
-
-$ACLOCAL
-: > ltmain.sh
-$AUTOMAKE -a
-
-grep 'rm -f .*\.lo' sub/Makefile.in
-
-:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]