todo-mode.el: Remove dependence on auto-mode-alist.
[bpt/emacs.git] / doc / lispref / two-volume.make
CommitLineData
ba318903 1# Copyright (C) 2007-2014 Free Software Foundation, Inc.
c85c5553
KB
2# See end for copying conditions.
3
4# although it would be nice to use tex rather than pdftex to avoid
5# colors, spurious warnings about names being referenced but not
6# existing, etc., dvips | ps2pdf doesn't preserve the page size.
7# Instead of creating a special dvips config file, put up with the warnings.
5b6eebcf
GM
8# (Note added 2012/05: for me, using texlive-2007-57, pdftex
9# doesn't work for reason, but tex does.)
b5776ecf 10texinfodir=../misc
143d9dd8 11emacsdir=../emacs
b5776ecf 12
143d9dd8 13tex = TEXINPUTS=".:$(texinfodir):${emacsdir}:${TEXINPUTS}" pdftex -interaction=nonstopmode
c85c5553
KB
14
15all: vol1.pdf vol2.pdf
16
5b6eebcf
GM
17# There's probably a better way to do this, without using a temp file.
18# Something like:
19# tex -jobname=vol1 '\def\SETVOL1 \input{elisp.texi}'
20# but I don't know what to use for "\def\SETVOL1".
21tex1 = sed '/^@setfilename/a\
22@set VOL1' elisp.texi > elisp1tmp.tex && $(tex) -jobname=vol1 elisp1tmp.tex
23
24tex2 = sed '/^@setfilename/a\
25@set VOL2' elisp.texi > elisp2tmp.tex && $(tex) -jobname=vol2 elisp2tmp.tex
26
27# elisp.texi specially defines \tocreadfilename when VOL1 or VOL2 is
28# set, so we can use our premade .toc's.
c85c5553
KB
29#
30vol1.pdf: elisp1med-fns-ready elisp1med-aux-ready elisp1med-toc-ready
31 @echo -e "\f Final TeX run for volume 1..."
32 cp elisp1med-toc-ready elisp1-toc-ready.toc
33 cp elisp1med-fns-ready vol1.fns
34 cp elisp1med-aux-ready vol1.aux
5b6eebcf 35 $(tex1)
c85c5553
KB
36#
37vol2.pdf: elisp2med-fns-ready elisp2med-aux-ready elisp2med-toc-ready
38 @echo "Final TeX run for volume 2..."
39 cp elisp2med-toc-ready elisp2-toc-ready.toc
40 cp elisp2med-fns-ready vol2.fns
41 cp elisp2med-aux-ready vol2.aux
5b6eebcf 42 $(tex2)
c85c5553
KB
43
44# \f intermediate toc files.
45#
46# vol1 toc: volume 1, page break, volume 2 (with II: prepended).
47elisp1med-toc-ready: elisp1med-init elisp2med-init
48 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
49 cat elisp1med-toc >>$@
50 echo '@page' >>$@
51 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
52 sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@
53#
54# vol2 toc: volume 1 (with I: prepended), page break, volume 2.
55elisp2med-toc-ready: elisp1med-init elisp2med-init
56 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
57 sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@
58 echo '@page' >>$@
59 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
60 cat elisp2med-toc >>$@
61
62
63# \f intermediate aux files.
64#
65# append vol2's fixed aux to normal vol1.
66elisp1med-aux-ready: elisp2med-aux-vol-added
67 cat elisp1med-aux $< >$@
68#
69# prepend vol1's fixed aux to vol2.
70elisp2med-aux-ready: elisp1med-aux-vol-added
71 cat $< elisp2med-aux >$@
72
73# on -pg entries, append volume number after page number.
74elisp1med-aux-vol-added: elisp1med-init
75 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie1}/' elisp1med-aux >$@
76#
77elisp2med-aux-vol-added: elisp2med-init
78 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2med-aux >$@
c85c5553
KB
79
80# \f intermediate index (fns) file.
81#
82elisp1med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added
83 cat elisp2med-fn-vol-added >>vol1.fn
84 texindex vol1.fn
85 cp vol1.fns $@
86#
87elisp2med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added
88 cat elisp1med-fn-vol-added >>vol2.fn
89 texindex vol2.fn
90 cp vol2.fns $@
91
92# Insert volume number (I: or II:) into index file.
93elisp1med-fn-vol-added: elisp1med-init
94 cp vol1.fn elisp1med-fn
95 sed 's/}{/}{I:/' elisp1med-fn >$@
96#
97elisp2med-fn-vol-added: elisp2med-init
98 cp vol2.fn elisp2med-fn
99 sed 's/}{/}{II:/' elisp2med-fn >$@
100
101# -----------------------------------------------------------------------------
102# everything above is essentially a duplicate of everything below. sorry.
103# -----------------------------------------------------------------------------
104
105# \f intermediate TeX runs.
106#
107# this generates what would be the final versions -- except the page
108# numbers aren't right. The process of adding the I: and II: changes
109# the page breaks, so a few index entries, at least are wrong. (In
110# 2007, x-meta-keysym in vol.II ended up on page 374 when the index had
111# it on page 375 from the initial run.)
112#
113# So, we start all over again, from these fns/aux/toc files.
114#
b5776ecf 115elisp1med-init: elisp1-fns-ready elisp1-aux-ready elisp1init-toc-ready $(texinfodir)/texinfo.tex
c85c5553
KB
116 @echo -e "\f Intermediate TeX run for volume 1..."
117 cp elisp1init-toc-ready elisp1-toc-ready.toc
118 cp elisp1-fns-ready vol1.fns
119 cp elisp1-aux-ready vol1.aux
5b6eebcf 120 $(tex1)
c85c5553
KB
121 texindex vol1.??
122 mv vol1.aux elisp1med-aux
123 mv vol1.toc elisp1med-toc
124#
b5776ecf 125elisp2med-init: elisp2-fns-ready elisp2-aux-ready elisp2init-toc-ready $(texinfodir)/texinfo.tex
c85c5553
KB
126 @echo "Final TeX run for volume 2..."
127 cp elisp2init-toc-ready elisp2-toc-ready.toc
128 cp elisp2-fns-ready vol2.fns
129 cp elisp2-aux-ready vol2.aux
5b6eebcf 130 $(tex2)
c85c5553
KB
131 texindex vol2.??
132 mv vol2.aux elisp2med-aux
133 mv vol2.toc elisp2med-toc
134
135
136# \f initial toc files.
137#
138# vol1 toc: volume 1, page break, volume 2 (with II: prepended).
139elisp1init-toc-ready: elisp1-init elisp2-init
140 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
141 cat elisp1-toc >>$@
142 echo '@page' >>$@
143 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
144 sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@
145#
146# vol2 toc: volume 1 (with I: prepended), page break, volume 2.
147elisp2init-toc-ready: elisp1-init elisp2-init
148 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
149 sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@
150 echo '@page' >>$@
151 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
152 cat elisp2-toc >>$@
153
154
155# \f initial aux files.
156#
157# append vol2's fixed aux to normal vol1. The initial runs saved
158# elisp1-aux and elisp2-aux.
159elisp1-aux-ready: elisp2-aux-vol-added
160 cat elisp1-aux $< >$@
161#
162# prepend vol1's fixed aux to vol2.
163elisp2-aux-ready: elisp1-aux-vol-added
164 cat $< elisp2-aux >$@
165
166# on -pg entries, append volume number after page number.
167elisp1-aux-vol-added: elisp1-init
168 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie1}/' elisp1-aux >$@
169#
170elisp2-aux-vol-added: elisp2-init
171 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2-aux >$@
c85c5553
KB
172
173# \f initial index (fns) file.
174#
175# Append other volume's index entries to this one's.
176# Index entries in this volume will then take precedence.
177elisp1-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added
178 cat elisp2-fn-vol-added >>vol1.fn
179 texindex vol1.fn
180 cp vol1.fns $@
181#
182elisp2-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added
183 cat elisp1-fn-vol-added >>vol2.fn
184 texindex vol2.fn
185 cp vol2.fns $@
186
187# Insert volume number (I: or II:) into index file.
188elisp1-fn-vol-added: elisp1-init
189 cp vol1.fn elisp1-fn
190 sed 's/}{/}{I:/' elisp1-fn >$@
191#
192elisp2-fn-vol-added: elisp2-init
193 cp vol2.fn elisp2-fn
194 sed 's/}{/}{II:/' elisp2-fn >$@
195
196
197# \f initial TeX runs.
198#
199# We use the .fn, .aux, and .toc files created here in subsequent
200# processing. The page numbers generated here will not be correct yet,
201# but we run texindex and TeX a second time just to get them closer.
202# Otherwise it might take even longer for them to converge.
203#
5b6eebcf 204elisp1-init: elisp.texi
c85c5553
KB
205 @echo -e "\f Initial TeX run for volume 1..."
206 rm -f vol1.aux vol1.toc
5b6eebcf 207 $(tex1)
c85c5553
KB
208 texindex vol1.??
209 mv vol1.aux elisp1-aux
210 mv vol1.toc elisp1-toc
211 touch $@
212#
5b6eebcf 213elisp2-init: elisp.texi
c85c5553
KB
214 @echo "Initial TeX run for volume 2..."
215 rm -f vol2.aux vol2.toc
5b6eebcf 216 $(tex2)
c85c5553
KB
217 texindex vol2.??
218 mv vol2.aux elisp2-aux
219 mv vol2.toc elisp2-toc
220 touch $@
221
222# COPYING CONDITIONS
223#
352c8b4a 224# This file is free software: you can redistribute it and/or modify
c85c5553 225# it under the terms of the GNU General Public License as published by
352c8b4a
GM
226# the Free Software Foundation, either version 3 of the License, or
227# (at your option) any later version.
c85c5553
KB
228#
229# This file is distributed in the hope that it will be useful,
230# but WITHOUT ANY WARRANTY; without even the implied warranty of
231# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
232# GNU General Public License for more details.
233#
234# You should have received a copy of the GNU General Public License
352c8b4a 235# along with this file. If not, see <http://www.gnu.org/licenses/>.
c85c5553 236