@@ -104,7 +104,7 @@ tut-all: tut.dvi tut.pdf tut.ps l2htut
104104
105105
106106# Rules to build PostScript and PDF formats
107- .SUFFIXES : .dvi .ps .pdf
107+ .SUFFIXES : .dvi .ps .pdf .tex
108108
109109.dvi.ps :
110110 $(DVIPS ) $< > $@
@@ -126,12 +126,7 @@ tut-all: tut.dvi tut.pdf tut.ps l2htut
126126# Dependencies
127127COMMONTEX =myformat.sty copyright.tex boilerplate.tex
128128
129- tut.dvi lib.dvi ext.dvi api.dvi : fix_hack $(COMMONTEX )
130-
131- # Tutorial document
132- tut.dvi : tut.tex
133- $(LATEX ) tut
134- $(LATEX ) tut
129+ $(DVIFILES ) : fix_hack $(COMMONTEX )
135130
136131# LaTeX source files for the Python Library Reference
137132LIBFILES = lib.tex \
@@ -168,31 +163,28 @@ LIBFILES = lib.tex \
168163
169164# Library document
170165lib.dvi : modindex.py indfix.py $(LIBFILES )
171- touch lib.ind
172- touch modules.ind
173- $(LATEX ) lib
174- ./modindex.py modules.idx
175- ./fix_hack lib.idx
176- $(MAKEINDEX ) lib.idx
177- ./indfix.py lib.ind
166+ echo ' \begin{theindex}\end{theindex}' > $* .ind
167+ echo ' \begin{theindex}\label{modindex}\end{theindex}' > modules.ind
168+ $(LATEX ) $*
178169 ./modindex.py modules.idx
179- $(LATEX ) lib
170+ ./fix_hack $* .idx
171+ $(MAKEINDEX ) $* .idx
172+ ./indfix.py $* .ind
173+ $(LATEX ) $*
180174
181- # Extensions document
182- ext.dvi : ext.tex
183- touch ext.ind
184- $(LATEX ) ext
185- ./fix_hack ext.idx
186- $(MAKEINDEX ) ext.idx
187- $(LATEX ) ext
175+ # Tutorial document
176+ tut.dvi : tut.tex
177+ $(LATEX ) $*
178+ $(LATEX ) $*
188179
189- # Python-C API document
190- api.dvi : api.tex
191- touch api.ind
192- $(LATEX ) api
193- ./fix_hack api.idx
194- $(MAKEINDEX ) api.idx
195- $(LATEX ) api
180+ # Extending & Embedding, Python/C API documents.
181+ # Done this way to avoid repeated command sets.
182+ .tex.dvi :
183+ echo ' \begin{theindex}\end{theindex}' > $* .ind
184+ $(LATEX ) $*
185+ ./fix_hack $* .idx
186+ $(MAKEINDEX ) $* .idx
187+ $(LATEX ) $*
196188
197189
198190# The remaining part of the Makefile is concerned with various
@@ -206,33 +198,35 @@ api.dvi: api.tex
206198.py.pyc :
207199 $(PYTHON ) -c " import $* "
208200
209- .PRECIOUS : lib.texi
201+ .PRECIOUS : python- lib.texi
210202
211203# The sed script in this target fixes a really nasty little condition in
212204# libcgi.tex where \e has to be used in a group to get the right behavior,
213- # and makeinfo can't handle a group with a leading @command. But at least
214- # the info file gets generated.
205+ # and makeinfo can't handle a group without a leading @command. But at
206+ # least the info file gets generated.
215207
216- lib1.texi : lib * .tex texipre.dat texipost.dat $(PARTPARSEOBJ )
208+ lib1.texi : $( LIBFILES ) texipre.dat texipost.dat $(PARTPARSEOBJ )
217209 $(PARTPARSE ) -o $@ ` ./whichlibs`
218210 sed ' s/"{\\}n{\\}n/"\\n\\n/' $@ > temp.texi
219211 mv temp.texi $@
220212
221- lib.texi : lib1.texi fix.el
213+ python- lib.texi : lib1.texi fix.el
222214 cp lib1.texi temp.texi
223215 $(EMACS ) -batch -l fix.el -f save-buffer -kill
224216 mv temp.texi $@
225217
226- python-lib.info : lib.texi
218+ python-lib.info : python- lib.texi
227219 $(MAKEINFO ) --footnote-style end --fill-column 72 \
228220 --paragraph-indent 0 $<
229221
230222# this is needed to prevent a second set of info files from being generated,
231223# at least when using GNU make
232- .PHONY : lib.info
224+ .PHONY : lib.info lib.texi
233225
234226lib.info : python-lib.info
235227
228+ lib.texi : python-lib.texi
229+
236230# Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
237231# HTML converter. For more info on this program, see
238232# <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
@@ -330,3 +324,6 @@ l2hclean:
330324# Remove temporaries as well as final products
331325clobber : clean
332326 rm -f * .dvi * .pdf * .ps * .texi * .info * .info-[0-9]*
327+
328+ realclean : clobber
329+ distclean : clobber
0 commit comments