2 # Copyright (C) 2011-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)
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 remake rules works from subdirectories, even using
18 # 'GNUmakefile' as makefiles name. This obviously requires GNU
20 # See also the other similar tests 'remake-subdir*.sh', and the
21 # related test 'aclocal5.sh'
26 magic1
='::MagicString::One::'
27 magic2
='__MagicString__Two__'
31 grep -i magic configure GNUmakefile.
in GNUmakefile \
32 sub
/GNUmakefile.
in sub
/GNUmakefile
35 cat > configure.ac
<<END
38 AC_CONFIG_FILES([GNUmakefile sub/GNUmakefile])
39 AC_SUBST([MAGIC], [magic])
43 cat > GNUmakefile.am
<<'END'
48 : > sub
/GNUmakefile.am
59 sed "s|magic|$magic1|" configure.ac
> t
65 $FGREP $magic1 configure
66 $FGREP $magic1 GNUmakefile
67 $FGREP $magic1 sub
/GNUmakefile
71 echo MAGIC
= $magic2 >> GNUmakefile.am
75 $FGREP $magic2 sub
/GNUmakefile
76 $FGREP $magic2 sub
/GNUmakefile.
in
77 $FGREP $magic1 sub
/GNUmakefile sub
/GNUmakefile.
in && exit 1
78 $FGREP $magic2 GNUmakefile GNUmakefile.
in && exit 1