On 08/02/2012 04:45 PM, Akim Demaille wrote:
> 
> Le 2 août 2012 à 16:18, Stefano Lattarini a écrit :
> 
>>> Why hide it? It will show anyway.  IMHO, this should be
>>> build-aux/automake/ or build-aux/mk.
>>>
>> I guess you use "build-aux" to mean "the directory specified by
>> AC_CONFIG_AUX_DIR", right?
> 
> Yes :)
> 
>>  If yes, I agree this would offer more
>> clarity and flexibility, so I'll implement the change in a follow-up
>> (with you and Bob in the "Suggested-by:" field).
> 
> Fine!
> 
Here it is (see attachment).  OK?

Thanks,
  Stefano
>From e0bfe7f9c8ad59537a685ac50c21d2e12c4cf570 Mon Sep 17 00:00:00 2001
Message-Id: <e0bfe7f9c8ad59537a685ac50c21d2e12c4cf570.1343928920.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <[email protected]>
Date: Thu, 2 Aug 2012 18:37:12 +0200
Subject: [PATCH] fragments: put them in a subdir of build-aux

This is a follow-up to previous commit 'v1.12.2-758-g19e2814'.

Instead of placing the verbatim makefile fragments in the directory
'$(top_srcdir)/.mk', we place them in '$(build-aux)/am-ng', where
'$(build-aux)' is the directory specified by AC_CONFIG_AUX_DIR, or,
if that is not explicitly specified, the directory automatically
determined by automake to help the auxiliary scripts and files (that
typically being '$(top_srcdir)').

* automake.in (verbatim): Implement the renaming.
* lib/am/distdir.am (am.dist.mk-files): Adjust to it.
* Makefile.am (amhello_configury): Likewise.
* .gitignore: Likewise.
* t/all2.sh: Likewise.
* t/conflnk2.sh: Likewise.
* t/serial-tests.sh: Likewise.
* t/spell.sh: Likewise.
* t/spell2.sh: Likewise.
* t/ax/depcomp.sh: Remove no-more-needed tweaks.
* t/ax/tap-setup.sh: Likewise.
* t/distdir.sh: Likewise.
* t/add-missing.tap: Adjust to avoid spurious failures.

Suggested-by: Bob Friesenhahn <[email protected]>
Suggested-by: Akim Demaille <[email protected]>
Signed-off-by: Stefano Lattarini <[email protected]>
---
 .gitignore        | 2 +-
 Makefile.am       | 2 +-
 automake.in       | 2 +-
 lib/am/distdir.am | 2 +-
 t/add-missing.tap | 6 +++---
 t/all2.sh         | 2 +-
 t/ax/depcomp.sh   | 2 +-
 t/ax/tap-setup.sh | 3 +--
 t/conflnk2.sh     | 2 +-
 t/distdir.sh      | 3 +--
 t/serial-tests.sh | 6 +++---
 t/spell.sh        | 2 +-
 t/spell2.sh       | 2 +-
 13 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/.gitignore b/.gitignore
index 6a6d5c2..6aab896 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-/.mk/
+/lib/am-ng
 /ChangeLog
 /aclocal.m4
 /configure
diff --git a/Makefile.am b/Makefile.am
index 1392f68..a660309 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -569,7 +569,7 @@ amhello_configury = \
   install-sh \
   missing \
   src/Makefile.in \
-  .mk
+  am-ng
 
 dist_noinst_DATA += $(amhello_sources)
 dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
diff --git a/automake.in b/automake.in
index 40b2c4d..d8e51d4 100644
--- a/automake.in
+++ b/automake.in
@@ -5776,7 +5776,7 @@ sub preprocess_file ($%)
 sub verbatim ($)
 {
   my $name = shift;
-  my $dir = '.mk';
+  my $dir = "$config_aux_dir/am-ng";
   my $file = "$dir/$name.mk";
   my $text = slurp_makefile_fragment ("$libdir/am/$name.mk");
   mkdir ($dir, 0755) if ! -d $dir;
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index ce5ff1b..efe576c 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -17,7 +17,7 @@
 am.dist.common-files += %DIST-COMMON%
 
 ## Makefile fragments used internally by automake-generated Makefiles.
-am.dist.mk-files = $(wildcard $(top_srcdir)/.mk/*)
+am.dist.mk-files = $(wildcard $(am.conf.aux-dir)/am-ng/*)
 
 ## Use 'sort', not 'am.util.uniq', for performance reasons.  Luckily, we
 ## don't care in which order the distributed files are.
diff --git a/t/add-missing.tap b/t/add-missing.tap
index c47382b..26cce13 100755
--- a/t/add-missing.tap
+++ b/t/add-missing.tap
@@ -175,8 +175,8 @@ check_ ()
     done
     # No files should be automatically installed by automake if it
     # is not told to.
-    if ls "$build_aux" | grep .; then r='not ok'; else r=ok; fi
-    result_ "$r" "$pfx no extra files installed"
+    command_ok_ "$pfx no extra files installed" \
+                eval '! ls "$build_aux" | grep -v "^am-ng$" | grep .'
     AUTOMAKE_run -d "$pfx automake run successfully" -- $opts
     ls -l . $build_aux
     # The expected files should get installed correctly (e.g., no
@@ -196,7 +196,7 @@ check_ ()
     # require 'missing' and 'install-sh', so account for them.
     all_files="install-sh missing $files"
     for f in $all_files; do echo $f; done | sort | uniq > files.exp
-    (cd $build_aux && ls) | sort > files.got
+    (cd $build_aux && ls) | grep -v '^am-ng$' | sort > files.got
     cat files.exp
     cat files.got
     command_ok_ \
diff --git a/t/all2.sh b/t/all2.sh
index e586b6e..2397d1d 100755
--- a/t/all2.sh
+++ b/t/all2.sh
@@ -27,7 +27,7 @@ for target in $targets; do
   $AUTOMAKE
   grep "${target}-local ${target}-local" Makefile.in && exit 1
   grep "${target}-am:.*${target}-local" Makefile.in \
-    || grep "${target}-am:.*${target}-local" .mk/*.mk
+    || grep "${target}-am:.*${target}-local" am-ng/*.mk
 done
 
 :
diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index 2a60dd9..5886691 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -106,7 +106,7 @@ setup_srcdir ()
   srcdir=$1 # This is intended to be global.
   mkdir -p "$srcdir" \
     || fatal_ "couldn't create source directory '$srcdir'"
-  cp -pR "$ocwd/$srctree"/* "$ocwd/$srctree"/.??* "$srcdir"/ \
+  cp -pR "$ocwd/$srctree"/* "$srcdir"/ \
     || fatal_ "couldn't populate source directory '$srcdir'"
 }
 
diff --git a/t/ax/tap-setup.sh b/t/ax/tap-setup.sh
index 3ea2a83..952a49d 100644
--- a/t/ax/tap-setup.sh
+++ b/t/ax/tap-setup.sh
@@ -28,8 +28,7 @@ test -f ../../automake && test -f ../../defs && test -d ../../t \
 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
   || fatal_ "failed to save Makefile.am"
 
-test -d ../tap-common-setup.dir \
-  && cp -fpR ../tap-common-setup.dir/* ../tap-common-setup.dir/.??* . \
+test -d ../tap-common-setup.dir && cp -fpR ../tap-common-setup.dir/* . \
   || fatal_ "couldn't get precomputed data files"
 
 fetch_tap_driver
diff --git a/t/conflnk2.sh b/t/conflnk2.sh
index 8c0bf9b..e9d00e0 100755
--- a/t/conflnk2.sh
+++ b/t/conflnk2.sh
@@ -45,7 +45,7 @@ $MAKE distdir
 
 find $distdir # For debugging.
 
-rm -rf $distdir/.mk
+rm -rf $distdir/am-ng
 
 test -f $distdir/src
 test -f $distdir/src2
diff --git a/t/distdir.sh b/t/distdir.sh
index d73e445..8edf6f0 100755
--- a/t/distdir.sh
+++ b/t/distdir.sh
@@ -71,8 +71,7 @@ cat stdout
 
 # Make sure no './' appear in the directory names.  srcdir is '..', so
 # this also checks that no directory is created in the source tree.
-sed 's|/.mk/|@mk@|' stdout > stdout2
-grep 'MKDIR_P.*\.' stdout2 && exit 1
+grep 'MKDIR_P.*\.' stdout && exit 1
 
 cd ..
 ./configure --prefix "$(pwd)"
diff --git a/t/serial-tests.sh b/t/serial-tests.sh
index 2c6f9bc..8bf43aa 100755
--- a/t/serial-tests.sh
+++ b/t/serial-tests.sh
@@ -25,10 +25,10 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-grep '^include .*.top_srcdir./\.mk/serial-tests\.mk$' Makefile.in
+grep '^include .*/am-ng/serial-tests\.mk$' Makefile.in
 $FGREP 'parallel-tests.mk' Makefile.in && exit 1
-test -f .mk/serial-tests.mk
-test ! -e .mk/parallel-tests.mk
+test -f am-ng/serial-tests.mk
+test ! -e am-ng/parallel-tests.mk
 test ! -e test-driver
 
 :
diff --git a/t/spell.sh b/t/spell.sh
index 3fd31d9..58202af 100755
--- a/t/spell.sh
+++ b/t/spell.sh
@@ -42,7 +42,7 @@ $MAKE 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 
 LC_ALL=C sed -e 's|^Makefile:[0-9][0-9]*: ||' \
-             -e 's|^\.mk/.*\.mk:[0-9][0-9]*: ||' \
+             -e 's|.*\.mk:[0-9][0-9]*: ||' \
              -e '/^\*\*\*.*Automake-NG/d' stderr > got
 
 cat > exp << 'END'
diff --git a/t/spell2.sh b/t/spell2.sh
index 3a5a8eb..839e363 100755
--- a/t/spell2.sh
+++ b/t/spell2.sh
@@ -42,7 +42,7 @@ $MAKE 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 
 LC_ALL=C sed -e 's|^Makefile:[0-9][0-9]*: ||' \
-             -e 's|^\.mk/.*\.mk:[0-9][0-9]*: ||' \
+             -e 's|.*\.mk:[0-9][0-9]*: ||' \
              -e '/^\*\*\*.*Automake-NG/d' stderr > got
 
 cat > exp << 'END'
-- 
1.7.12.rc0

Reply via email to