Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / remake5.test
1 #! /bin/sh
2 # Copyright (C) 2003  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 # Check that AM_MAINTAINER_MODE disable some rebuild rules,
18 # but not all.
19 # Report from Ralf Corsepius.
20
21 required=GNUmake
22 . ./defs || Exit 1
23
24 set -e
25
26 cat >>configure.in <<'EOF'
27 AM_MAINTAINER_MODE
28 m4_include(foo.m4)
29 if test ! -f rebuild_ok; then
30   ACLOCAL=false
31   AUTOMAKE=false
32   AUTOCONF=false
33 fi
34 AC_OUTPUT
35 EOF
36
37 : > foo.m4
38 : > Makefile.am
39
40 $ACLOCAL
41 $AUTOCONF
42 $AUTOMAKE --add-missing
43 ./configure
44 $MAKE
45
46 # Make sure the rules to rebuild configure/Makefile.in are not
47 # triggered by default.  ($MAKE will fail if they are, because the
48 # tools are set to false.)
49 $sleep
50 touch aclocal.m4 Makefile.am configure.in foo.m4
51 $MAKE
52
53 # Make sure the rebuild rule for Makefile is triggered.
54 $sleep
55 echo '# GrEpMe' >>Makefile.in
56 $MAKE
57 grep GrEpMe Makefile
58
59 # Make sure the rebuild rule for config.status is triggered.
60 $sleep
61 grep 'AUTOCONF.*=.*false' Makefile
62 : > rebuild_ok
63 ./configure --no-create
64 $MAKE
65 grep 'AUTOCONF.*=.*false' Makefile && Exit 1
66
67 # Make sure rebuild rules do work if --enable-maintainer-mode is given.
68 ./configure --enable-maintainer-mode
69 $sleep
70 echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
71 $MAKE
72 grep YIPPY_YIPPY_YEAH Makefile