Revert Automake license to GPLv2+.
[platform/upstream/automake.git] / tests / remake7.test
1 #! /bin/sh
2 # Copyright (C) 2008  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 remaking rules fail when they should.
18
19 . ./defs || Exit 1
20 set -e
21
22 cat > configure.in << 'END'
23 AC_INIT
24 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
25 AC_OUTPUT(Makefile sub/Makefile)
26 END
27
28 cat > Makefile.am <<'END'
29 SUBDIRS = sub
30 END
31 mkdir sub
32 : > sub/Makefile.am
33
34 $ACLOCAL
35 $AUTOMAKE
36 $AUTOCONF
37 ./configure
38 $MAKE
39
40 $sleep
41
42 # Fail for broken input files.
43
44 echo "if FOO" > sub/Makefile.am
45 $MAKE && Exit 1
46
47 : >sub/Makefile.am
48 $MAKE
49
50 mv Makefile.am backup
51 echo "if FOO" > Makefile.am
52 $MAKE && Exit 1
53
54 # Fail for missing input files, with or without missing
55 # Makefile.in files.
56
57 cp backup Makefile.am
58 mv sub/Makefile.am sub/backup
59 $MAKE && Exit 1
60
61 rm -f sub/Makefile.in
62 $MAKE && Exit 1
63
64 mv sub/backup sub/Makefile.am
65 rm -f Makefile.am
66 $MAKE && Exit 1
67
68 rm -f Makefile.in
69 $MAKE && Exit 1
70 :