2 # Copyright (C) 2010-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)
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 the "all" target triggers rebuilt of outdated makefiles.
18 # This handle the case in which the makefiles are not called 'Makefile'.
19 # See also sister test 'remake-all-1.sh'.
25 magic1
=::MagicStringOne
::
26 magic2
=__MagicStringTwo__
27 magic3
=%%MagicStringThree
%%
29 cat > configure.ac
<<END
32 AC_CONFIG_FILES([$mkfile sub/$mkfile])
39 cat > $mkfile.am
<<END
41 AM_MAKEFLAGS = -f $mkfile
44 cat > sub
/$mkfile.am
<<END
45 AM_MAKEFLAGS = -f $mkfile
51 $EGREP "^all-am:.* $mkfile( |$)" $mkfile.
in sub
/$mkfile.
in
56 $FGREP "$magic1" mkfile.
in && exit 1 # Sanity check.
58 # Two code paths in configure.am:
60 # - either a file in $(am__configure_deps) has been updated ...
62 echo "AC_SUBST([FOO])" >> configure.ac
64 $FGREP FOO
$mkfile # For debugging.
65 $FGREP $magic1 $mkfile
67 # - ... or not; i.e., Makefile.am or an included file has.
69 echo "# $magic2" >> $mkfile.am
70 echo "# $magic3" >> sub
/$mkfile.am
72 $FGREP $magic2 $mkfile
73 $FGREP $magic3 sub
/$mkfile