tests: never source test-defs.sh directly, source test-lib.sh instead
[automake.git] / t / clean2.sh
blobce5e9bf48b235cefd9ba4983824341c571156b2e
1 #! /bin/sh
2 # Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Make sure distclean works in cygnus mode.
18 # Report from Daniel Jacobowitz.
20 . ./defs || exit 1
22 cat >> configure.ac << 'END'
23 AM_MAINTAINER_MODE
24 AC_CONFIG_FILES([sub/Makefile])
25 AC_OUTPUT
26 END
28 cat > Makefile.am << 'END'
29 SUBDIRS = sub
31 data_DATA = bar
33 bar:
34 touch $@
36 DISTCLEANFILES = bar
37 END
39 mkdir sub
41 cat > sub/Makefile.am << 'END'
42 data_DATA = foo
44 foo:
45 touch $@
47 CLEANFILES = $(data_DATA)
48 END
50 $ACLOCAL
51 $AUTOCONF
52 $AUTOMAKE --cygnus -Wno-obsolete
54 ./configure
55 $MAKE
56 ls -l
57 test -f bar
58 test -f sub/foo
59 $MAKE distclean
60 ls -l
61 test ! -e bar
62 test ! -e sub/foo
63 test ! -e Makefile
64 test ! -e config.status
65 test -f Makefile.in
66 test -f configure