news: update w.r.t. recent depcomp changes
[automake.git] / t / remake-maintainer-mode.sh
blob326a3c919d0201acce58cfbe568f3b7d3e517528
1 #! /bin/sh
2 # Copyright (C) 2003-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 # Check that AM_MAINTAINER_MODE disable some rebuild rules,
18 # but not all.
19 # Report from Ralf Corsepius.
21 . test-init.sh
23 if using_gmake; then
24 remake="$MAKE"
25 else
26 remake="$MAKE Makefile"
29 cat >>configure.ac <<'EOF'
30 AM_MAINTAINER_MODE
31 m4_include([foo.m4])
32 if test ! -f rebuild_ok; then
33 ACLOCAL=false
34 AUTOMAKE=false
35 AUTOCONF=false
37 AC_OUTPUT
38 EOF
40 : > foo.m4
41 : > Makefile.am
43 $ACLOCAL
44 $AUTOCONF
45 $AUTOMAKE --add-missing
46 ./configure
47 $MAKE
49 # Make sure the rules to rebuild configure/Makefile.in are not
50 # triggered by default. ($MAKE will fail if they are, because the
51 # tools are set to false.)
52 $sleep
53 touch aclocal.m4 Makefile.am configure.ac foo.m4
54 $remake
56 # Make sure the rebuild rule for Makefile is triggered.
57 $sleep
58 echo '# GrEpMe' >>Makefile.in
59 $remake
60 grep GrEpMe Makefile
62 # Make sure the rebuild rule for config.status is triggered.
63 $sleep
64 grep 'AUTOCONF.*=.*false' Makefile
65 : > rebuild_ok
66 ./configure --no-create
67 $remake
68 grep 'AUTOCONF.*=.*false' Makefile && exit 1
70 # Make sure rebuild rules do work if --enable-maintainer-mode is given.
71 ./configure --enable-maintainer-mode
72 $sleep
73 echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
74 $remake
75 grep YIPPY_YIPPY_YEAH Makefile
77 # Try the distribution, for completeness.
78 $MAKE distcheck