46ab4b70dfc1cf7f1019dacbf4f234af782642dd
[platform/upstream/automake.git] / tests / clean2.test
1 #! /bin/sh
2 # Copyright (C) 2004, 2010, 2011 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Make sure distclean works in cygnus mode.
18 # Report from Daniel Jacobowitz.
19
20 . ./defs || Exit 1
21
22 cat >> configure.in << 'END'
23 AM_MAINTAINER_MODE
24 AC_CONFIG_FILES([sub/Makefile])
25 AC_OUTPUT
26 END
27
28 cat > Makefile.am << 'END'
29 SUBDIRS = sub
30
31 data_DATA = bar
32
33 bar:
34         touch $@
35
36 DISTCLEANFILES = bar
37 END
38
39 mkdir sub
40
41 cat > sub/Makefile.am << 'END'
42 data_DATA = foo
43
44 foo:
45         touch $@
46
47 CLEANFILES = $(data_DATA)
48 END
49
50 $ACLOCAL
51 $AUTOCONF
52 $AUTOMAKE --cygnus
53
54 ./configure
55 $MAKE
56 ls -l
57 test -f bar
58 test -f sub/foo
59 $MAKE distclean
60 ls -l
61 test ! -r bar
62 test ! -r sub/foo
63 test ! -r Makefile
64 test ! -r config.status
65 test -f Makefile.in
66 test -f configure
67
68 :