Merge branch 'simplify-exit-trap-workaround' into maint
[platform/upstream/automake.git] / t / txinfo-no-clutter.sh
1 #! /bin/sh
2 # Copyright (C) 2012 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 # The pdf, ps and dvi targets shouldn't let clutter in the build directory.
18 # Related to automake bug#11146.
19
20 required='makeinfo tex texi2dvi-o dvips'
21 . ./defs || exit 1
22
23 mkdir sub
24
25 echo AC_OUTPUT >> configure.ac
26
27 cat > Makefile.am << 'END'
28 all-local: ps pdf dvi html
29 info_TEXINFOS = foo.texi sub/bar.texi
30 END
31
32 cat > foo.texi << 'END'
33 \input texinfo
34 @setfilename foo.info
35 @settitle foo
36 @node Top
37 Hello walls.
38 @include version.texi
39 @bye
40 END
41
42 cat > sub/bar.texi << 'END'
43 \input texinfo
44 @setfilename bar.info
45 @settitle bar
46 @node Top
47 Hello walls.
48 @include version2.texi
49 @bye
50 END
51
52 cat > baz.texi << 'END'
53 \input texinfo
54 @setfilename baz.info
55 @settitle baz
56 @node Top
57 Hello walls.
58 @bye
59 END
60
61 cat > baz.texi << 'END'
62 \input texinfo
63 @setfilename baz.info
64 @settitle baz
65 @defindex au
66 @defindex sa
67 @defindex sb
68 @synindex sa sb
69 @node Top
70 Hello walls.
71 @cindex foo
72 foo
73 @pindex bar
74 bar
75 @auindex baz
76 baz
77 @saindex sa
78 sa
79 @sbindex sb
80 sb
81 @bye
82 END
83
84 $ACLOCAL
85 $AUTOMAKE --add-missing
86 $AUTOCONF
87
88 ./configure
89
90 # Try one by one, to ensure later targets don't involuntarily
91 # clean up potential cruft left by earlier ones.
92 for fmt in info pdf ps dvi html all; do
93   $MAKE $fmt
94   ls -l . sub # For debugging.
95   ls -d foo* baz* sub/bar* > lst
96   $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info)$' lst && exit 1
97   $MAKE clean
98 done
99
100 $MAKE distcheck
101
102 :