Merge branch 'fix-pr13588-pax-hangs' into branch-1.13.2
[automake.git] / t / remake-am-pr10111.sh
blob1514207cfddad73a2bcf9f452512ba2d1e97492b
1 #! /bin/sh
2 # Copyright (C) 2011-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)
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 <http://www.gnu.org/licenses/>.
17 # Check that our remake rules doesn't give spurious successes in
18 # some corner case situations where they should actually fail.
19 # See automake bug#10111.
20 # To be clear, we are speaking about *very* corner-case situations here,
21 # and the fact that the remake rules might get confused in them is not a
22 # big deal in practice (in fact, this test *currently fails*). Still,
23 # keeping the limitation exposed is a good idea anyway.
25 . test-init.sh
27 cat >> configure.ac <<'END'
28 AC_OUTPUT
29 END
31 : > foobar.am
33 cat > Makefile.am <<'END'
34 include $(srcdir)/foobar.am
35 $(srcdir)/foobar.am:
36 ## Creative quoting is to avoid spurious matches in the grepping
37 ## of Makefile.in, later.
38 echo "mu =" foobar "was here =" > $@
39 END
41 $ACLOCAL
42 $AUTOCONF
43 $AUTOMAKE
45 ./configure
47 # OK, so the developer wants to interactively try out how the
48 # "distributed form" of his package behaves.
49 $MAKE distdir
50 cd $distdir
51 # He's interested in trying out a VPATH build.
52 mkdir build
53 cd build
54 ../configure
55 # He wants to verify that the rules he's written to rebuild a file
56 # included by configure.ac works also in VPATH builds.
57 rm -f ../foobar.am
58 $MAKE
59 grep '= foobar was here =' ../Makefile.in
60 $MAKE distcheck