2 # Copyright (C) 2010-2013 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 # Test remake rules for am files included (also recursively) by
18 # Makefile.am. Keep in sync with sister tests:
19 # - remake-include-aclocal.sh
20 # - remake-include-configure.sh
25 magic1=::MagicStringOne::
26 magic2=__MagicStringTwo__
27 magic3=%%MagicStringThree%%
32 remake="$MAKE Makefile"
35 cat >> configure.ac <<'END'
39 cat > Makefile.am <<'END'
43 ## Used by "make distcheck" later.
45 test -f $(top_srcdir)/foo.am
46 test ! -r $(top_srcdir)/bar.am
47 test x'$(FINGERPRINT)' = x'DummyValue'
50 echo 'FINGERPRINT = BadBadBad' > foo.am
56 for vpath in : false; do
67 $MAKE # Should be a no-op.
70 echo "FINGERPRINT = $magic1" > $top_srcdir/foo.am
72 $FGREP FINGERPRINT Makefile # For debugging.
73 $FGREP $magic1 Makefile
76 echo "FINGERPRINT = $magic2" > $top_srcdir/foo.am
78 $FGREP FINGERPRINT Makefile # For debugging.
79 $FGREP $magic1 Makefile && exit 1
80 $FGREP $magic2 Makefile
83 echo 'include $(top_srcdir)/bar.am' > $top_srcdir/foo.am
84 echo "FINGERPRINT = $magic3" > $top_srcdir/bar.am
86 $FGREP FINGERPRINT Makefile # For debugging.
87 $FGREP $magic1 Makefile && exit 1
88 $FGREP $magic2 Makefile && exit 1
89 $FGREP $magic3 Makefile
92 echo "FINGERPRINT = $magic1" > $top_srcdir/bar.am
94 $FGREP $magic2 Makefile && exit 1
95 $FGREP $magic3 Makefile && exit 1
96 $FGREP $magic1 Makefile
99 echo "FINGERPRINT = DummyValue" > $top_srcdir/foo.am
100 using_gmake || $remake
102 $FGREP $magic1 Makefile && exit 1 # Sanity check.
103 $FGREP $magic2 Makefile && exit 1 # Likewise.
104 $FGREP $magic3 Makefile && exit 1 # Likewise.