Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / remake-am-pr10111.test
1 #! /bin/sh
2 # Copyright (C) 2011 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
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.
24
25 . ./defs || Exit 1
26
27 set -e
28
29 cat >> configure.in <<'END'
30 AC_OUTPUT
31 END
32
33 : > foobar.am
34
35 cat > Makefile.am <<'END'
36 include $(srcdir)/foobar.am
37 $(srcdir)/foobar.am:
38 ## Creative quoting is to avoid spurious matches in the grepping
39 ## of Makefile.in, later.
40         echo "mu =" foobar "was here =" > $@
41 END
42
43 $ACLOCAL
44 $AUTOCONF
45 $AUTOMAKE
46
47 ./configure
48
49 # OK, so the developer wants to interactively try out how the
50 # "distributed form" of his package behaves.
51 $MAKE distdir
52 cd $distdir
53 # He's interested in trying out a VPATH build.
54 mkdir build
55 cd build
56 ../configure
57 # He wants to verify that the rules he's written to rebuild a file
58 # included by configure.in works also in VPATH builds.
59 rm -f ../foobar.am
60 $MAKE
61 grep '= foobar was here =' ../Makefile.in
62 $MAKE distcheck
63
64 :