tests: make 'lzip.test' executable
[automake.git] / tests / remake-deleted-am-2.test
blob07142f662d928c3271a9862b875388406751e773
1 #! /bin/sh
2 # Copyright (C) 2011 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 inclusion of `.am' fragments by automake does not suffer
18 # of the "deleted header problem". This test checks deeper inclusion
19 # stacks, and use VPATH builds.
21 . ./defs || Exit 1
23 set -e
25 echo AC_OUTPUT >> configure.in
27 $ACLOCAL
28 $AUTOCONF
30 cat > Makefile.am <<'END'
31 include $(srcdir)/foo.am
32 END
34 cat > foo.am <<'END'
35 # this is foo
36 include sub/bar.am
37 include baz.am
38 END
40 mkdir sub
41 echo 'include $(top_srcdir)/sub/zardoz.am' > sub/bar.am
42 echo '# this is zardoz' > sub/zardoz.am
44 echo 'include fnord.am' > baz.am
45 echo '# you are not seeing this' > fnord.am
47 $AUTOMAKE
48 # Sanity checks.
49 $FGREP 'this is zardoz' Makefile.in
50 $FGREP 'you are not seeing this' Makefile.in
52 mkdir build
53 cd build
55 srcdir=..
57 $srcdir/configure
58 $MAKE
60 $sleep
61 echo '# this is baz' > $srcdir/baz.am
62 rm -f $srcdir/fnord.am
63 $MAKE
64 # Sanity checks.
65 $FGREP 'you are not seeing this' $srcdir/Makefile.in Makefile && Exit 1
66 $FGREP 'this is baz' $srcdir/Makefile.in
67 $FGREP 'this is baz' Makefile
69 $sleep
70 rm -rf $srcdir/sub $srcdir/foo.am $srcdir/baz.am
71 echo '# no more inclusions' > $srcdir/Makefile.am
72 $MAKE
73 # Sanity checks.
74 $EGREP 'this is (foo|bar|baz)' Makefile $srcdir/Makefile.in && Exit 1
75 $FGREP 'no more inclusions' Makefile