2 # Copyright (C) 2011-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 remake rules works from subdirectories, even when makefiles
18 # are not named "Makefile".
19 # See also the other similar tests 'remake-subdir*.sh', and the
20 # related test 'aclocal5.sh'.
24 magic1='::MagicString::One::'
25 magic2='__MagicString__Two__'
29 grep -i magic configure build.in build.mk sub/build.in sub/build.mk
32 cat > configure.ac <<END
35 AC_CONFIG_FILES([build.mk:build.in])
36 AC_CONFIG_FILES([sub/build.mk:sub/build.in])
37 AC_SUBST([MAGIC], [magic])
41 cat > build.am <<'END'
42 AM_MAKEFLAGS = -f build.mk
47 cat > sub/build.am <<'END'
48 AM_MAKEFLAGS = -f build.mk
55 ls -l # For debugging.
61 sed "s|magic|$magic1|" configure.ac > t
64 $MAKE -f build.mk build.mk
67 $FGREP $magic1 configure
68 $FGREP $magic1 build.mk
69 $FGREP $magic1 sub/build.mk
73 echo MAGIC = $magic2 >> build.am
74 $MAKE -f build.mk build.mk
77 $FGREP $magic2 sub/build.mk
78 $FGREP $magic2 sub/build.in
79 $FGREP $magic1 sub/build.in sub/build.mk && exit 1
80 $FGREP $magic2 build.in build.mk && exit 1