From a717979628bfbc5b4f1e9545dc7e56615dfbba5b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 6 Jun 2002 08:34:39 +0000 Subject: [PATCH] * 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. --- ChangeLog | 9 +++++++ Makefile.in | 7 +++-- lib/am/configure.am | 14 +++++++++- tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/maintclean.test | 59 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 88 insertions(+), 3 deletions(-) create mode 100755 tests/maintclean.test diff --git a/ChangeLog b/ChangeLog index e11000f0..f68ba238 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-06-06 Alexandre Duret-Lutz + + * 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. + 2002-06-05 Miloslav Trmac * lib/am/dejagnu.am (site.exp): Quote build_alias, host_alias, and diff --git a/Makefile.in b/Makefile.in index d2bc8951..8878d452 100644 --- a/Makefile.in +++ b/Makefile.in @@ -127,6 +127,8 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .dvi .info .ps .texi + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile @@ -506,7 +508,7 @@ clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive - -rm -f config.status config.cache config.log + -rm -f $(am__CONFIG_DISTCLEAN_FILES) distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive @@ -553,7 +555,8 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive - + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf autom4te.cache maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti diff --git a/lib/am/configure.am b/lib/am/configure.am index 465c5773..bc1f34a5 100644 --- a/lib/am/configure.am +++ b/lib/am/configure.am @@ -83,10 +83,22 @@ endif %?TOPDIR_P% ## 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% diff --git a/tests/Makefile.am b/tests/Makefile.am index d96e2afa..57c335eb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -216,6 +216,7 @@ lisp.test \ listval.test \ ltdeps.test \ ltlibobjs.test \ +maintclean.test \ make.test \ makevars.test \ man.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index acc61e5f..d49919e5 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -300,6 +300,7 @@ lisp.test \ listval.test \ ltdeps.test \ ltlibobjs.test \ +maintclean.test \ make.test \ makevars.test \ man.test \ diff --git a/tests/maintclean.test b/tests/maintclean.test new file mode 100755 index 00000000..a6991bf6 --- /dev/null +++ b/tests/maintclean.test @@ -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 -- 2.43.5