doc: typos in test file.
[automake.git] / t / remake-all-1.sh
blob0e22daacc32a16e5056f57ced5b23e185449e13c
1 #! /bin/sh
2 # Copyright (C) 2010-2024 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 <https://www.gnu.org/licenses/>.
17 # Check that the "all" target triggers rebuilt of outdated Makefiles.
18 # See also sister test 'remake-all-2.sh'.
20 . test-init.sh
22 mkfile=Makefile
24 magic1=::MagicStringOne::
25 magic2=__MagicStringTwo__
26 magic3=%%MagicStringThree%%
28 cat > configure.ac <<END
29 AC_INIT([$me], [1.0])
30 AM_INIT_AUTOMAKE
31 AC_CONFIG_FILES([$mkfile sub/$mkfile])
32 FOO='$magic1'
33 AC_OUTPUT
34 END
36 mkdir sub
37 echo SUBDIRS = sub > $mkfile.am
38 : > sub/$mkfile.am
40 $ACLOCAL
41 $AUTOMAKE
43 $EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in
45 $AUTOCONF
46 ./configure
48 $FGREP "$magic1" mkfile.in && exit 1 # Sanity check.
50 # Two code paths in configure.am:
52 # - either a file in $(am__configure_deps) has been updated ...
53 $sleep
54 echo "AC_SUBST([FOO])" >> configure.ac
55 $MAKE
56 $FGREP FOO $mkfile # For debugging.
57 $FGREP $magic1 $mkfile
59 # - ... or not; i.e., Makefile.am or an included file has.
60 $sleep
61 echo "# $magic2" >> $mkfile.am
62 echo "# $magic3" >> sub/$mkfile.am
63 $MAKE
64 $FGREP $magic2 $mkfile
65 $FGREP $magic3 sub/$mkfile