automake-patches
[Top][All Lists]
Advanced

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

FYI: Re: Patch: remove autom4te.cache


From: Alexandre Duret-Lutz
Subject: FYI: Re: Patch: remove autom4te.cache
Date: Thu, 06 Jun 2002 10:28:43 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

 >>>>>> "Akim" == Akim Demaille <address@hidden> writes:
 >>>>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:
 >>>>>> "Tom" == Tom Tromey <address@hidden> writes:

 Akim> [`make distclean' deletes `autom4te.cache']

 Tom> I think we want this for 1.6.2.  I propose checking it in on the
 Tom> branch only, and on the trunk using config.status --clean.

 adl> Isn't `config.status --clean' expected to clean only the files
 adl> created by `config.status'?  I don't think that's its job to
 adl> remove `autom4te.cache'.

 Akim> Very much agreed.

 Akim> I should make clearer what I meant:

 Akim> 1. config.status --clean is really needed.

 Akim> 2. the only valid target to remove autom4te.cache is maintainer-check.
 Akim> If you have an autom4te.cache that cause distcheck to fail, then
 Akim> it is a good news: you finally discovered that autoconf and/or
 Akim> autoheader is needed to use your tarball, which is wrong.

I'm checking in this on HEAD and branch.  This also fixes the
bug that config.status and siblings were not removed by
maintainer-clean.

2002-06-06  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/configure.am (am__CONFIG_DISTCLEAN_FILES): New variable.
        (distclean): Use it.
        (maintainer-clean): Delete autom4te.cache and
        $(am__CONFIG_DISTCLEAN_FILES).
        * tests/maintclean.test: New file.
        * tests/Makefile.am (TESTS): Add maintclean.test.

Index: lib/am/configure.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/configure.am,v
retrieving revision 1.12
diff -u -r1.12 configure.am
--- lib/am/configure.am 7 Jan 2002 00:37:50 -0000       1.12
+++ lib/am/configure.am 6 Jun 2002 08:24:31 -0000
@@ -83,10 +83,22 @@
 ## Makefile depends on config.status.
 
 if %?TOPDIR_P%
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log
 distclean:
-       -rm -f config.status config.cache config.log
+       -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.
+
+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 autom4te.cache
+
+
 endif %?TOPDIR_P%
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.385.2.11
diff -u -r1.385.2.11 Makefile.am
--- tests/Makefile.am   31 May 2002 17:47:36 -0000      1.385.2.11
+++ tests/Makefile.am   6 Jun 2002 08:24:31 -0000
@@ -216,6 +216,7 @@
 listval.test \
 ltdeps.test \
 ltlibobjs.test \
+maintclean.test \
 make.test \
 makevars.test \
 man.test \
Index: tests/maintclean.test
===================================================================
RCS file: tests/maintclean.test
diff -N tests/maintclean.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/maintclean.test       6 Jun 2002 08:24:31 -0000
@@ -0,0 +1,59 @@
+#! /bin/sh
+
+# Make sure distclean and maintainer-clean erase the right files.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES(bar)
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+noinst_DATA = foo.c
+
+foo.c:
+       touch foo.c
+
+MAINTAINERCLEANFILES = foo.c
+
+END
+
+touch bar.in
+
+# Since we don't require Yacc, make sure it's not used.
+export YACC=false
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+test -d autom4te.cache
+
+./configure
+test -f bar
+
+$MAKE
+test -f foo.c
+
+$MAKE distclean
+test ! -f bar
+test ! -f Makefile
+test ! -f config.status
+test -f foo.c
+test -d autom4te.cache
+
+./configure
+test -f bar
+
+$MAKE foo.c
+test -f foo.c
+
+$MAKE maintainer-clean
+test ! -f bar
+test ! -f foo.c
+test ! -f Makefile
+test ! -f config.status
+test ! -d autom4te.cache
-- 
Alexandre Duret-Lutz




reply via email to

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