Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / remake-deleted-am.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 inclusion of `.am' fragments by automake does not suffer
18 # of the "deleted header problem".  Basic checks are done here.
19
20 . ./defs || Exit 1
21
22 set -e
23
24 echo AC_OUTPUT >> configure.in
25
26 $ACLOCAL
27 $AUTOCONF
28
29 cat > Makefile.am <<'END'
30 include foo.am
31 include $(srcdir)/bar.am
32 include $(top_srcdir)/baz.am
33 END
34
35 echo '# this is foo' > foo.am
36 echo '# this is bar' > bar.am
37 echo '# this is baz' > baz.am
38
39 $AUTOMAKE
40 # Sanity checks.
41 $FGREP 'this is foo' Makefile.in
42 $FGREP 'this is bar' Makefile.in
43 $FGREP 'this is baz' Makefile.in
44
45 ./configure
46 $MAKE # Should be no-op.
47
48 $sleep
49 sed '/^include foo\.am$/d' Makefile.am > t
50 mv -f t Makefile.am
51 rm -f foo.am
52 $MAKE Makefile
53 # Sanity checks.
54 $FGREP 'this is foo' Makefile.in Makefile && Exit 1
55 $FGREP 'this is bar' Makefile.in
56 $FGREP 'this is bar' Makefile
57 $FGREP 'this is baz' Makefile.in
58 $FGREP 'this is baz' Makefile
59
60 $sleep
61 echo '# empty empty' > Makefile.am
62 rm -f bar.am baz.am
63 $MAKE Makefile
64 # Sanity checks.
65 $FGREP 'empty empty' Makefile.in
66 $FGREP 'empty empty' Makefile
67 grep 'this is ba[rz]' Makefile Makefile.in && Exit 1
68
69 :