2 # Copyright (C) 2012-2024 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)
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 <https://www.gnu.org/licenses/>.
17 # The info, html, pdf, ps and dvi targets shouldn't let clutter in the
18 # build directory. Related to automake bug#11146.
20 required
='makeinfo tex texi2dvi dvips'
23 cat >> configure.ac
<<'END'
24 AC_CONFIG_FILES([sub/Makefile])
28 cat > Makefile.am
<< 'END'
29 all-local
: ps pdf dvi html
# For "make distcheck".
30 info_TEXINFOS
= foo.texi
doc
/bar.texi baz.texi
33 # Tell GNU make not to parallelize these, because they
34 # have overlap between explicit and intermediate .dvi files.
40 cat > sub
/Makefile.am
<< 'END'
41 all-local
: ps pdf dvi html
# For "make distcheck".
42 info_TEXINFOS
= baz.texi
45 cat > foo.texi
<< 'END'
55 cat > doc
/bar.texi
<< 'END'
61 @include version2.texi
65 cat > baz.texi
<< 'END'
90 $AUTOMAKE --add-missing
95 # Try one by one, to ensure later targets don't involuntarily
96 # clean up potential cruft left by earlier ones.
97 for fmt in info pdf ps dvi html all
; do
110 for x
in info pdf ps dvi
; do
129 ls -d foo
* baz
* sub
/baz
* doc
/bar
* > lst
130 basename_rx
='(foo|doc/bar|baz|sub/baz)'
132 pdf
) extension_rx
="(texi|pdf|t2p)";;
133 dvi
) extension_rx
="(texi|dvi|t2d)";;
134 ps
) extension_rx
="(texi|ps|dvi|t2d)";;
135 info
) extension_rx
="(texi|info)";;
136 html
) extension_rx
="(texi|html)";;
137 all
) extension_rx
="(texi|html|info|pdf|ps|dvi|t2[pd])";;
138 *) fatal_
"unreachable code reached";;
140 $EGREP -v "^$basename_rx\.$extension_rx$" lst
&& exit 1
141 # Cleanup for checks on the next format.
143 info
) rm -f *.info
doc
/*.info sub
/*.info
;;