diff options
Diffstat (limited to 't/cleanvars.sh')
-rw-r--r-- | t/cleanvars.sh | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/t/cleanvars.sh b/t/cleanvars.sh new file mode 100644 index 000000000..c9fcee0e3 --- /dev/null +++ b/t/cleanvars.sh @@ -0,0 +1,100 @@ +#! /bin/sh +# Copyright (C) 2001-2014 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. + +. test-init.sh + +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 + +: |