4646# Customizations -- you *may* have to edit these
4747
4848# Where are the various programs?
49- LATEX = latex
50- PDFLATEX = pdflatex
51- BIBTEX = bibtex
49+ LATEX = TEXINPUTS= $( TEXINPUTS ) latex
50+ PDFLATEX = TEXINPUTS= $( TEXINPUTS ) pdflatex
51+ TEXINPUTS = texinputs:
5252DVIPS = dvips -f -N0
5353DISTILL = distill
5454MAKEINDEX = makeindex
55- L2H = latex2html
55+ L2H = TEXINPUTS= $( TEXINPUTS ) latex2html -init_file perl/l2hinit.perl
5656L2HARGS = -address $$LOGNAME@` domainname `
57+ WEBCHECKER = $(PYTHON ) ../Tools/webchecker/webchecker.py
5758
5859# Install destination -- not used now but might be useful some time...
5960DESTDIR = /usr/local
6061LIBDESTDIR = $DESTDIR/lib
61- LIBDEST = $LIBDESTDIR/python
62+ LIBDEST = $LIBDESTDIR/python$( VERSION )
6263DOCDESTDIR = $LIBDEST/doc
6364
6465# This is only used for .info generation:
6566EMACS = emacs
6667PYTHON = python
6768MAKEINFO = makeinfo
68- # When debugging partparse.py, make this the pyc file:
69- PARTPARSEOBJ = partparse.pyc
70- PARTPARSE = $(PYTHON ) $(PARTPARSEOBJ )
69+ PARTPARSE = $(PYTHON ) tools/partparse.py
7170
7271# Ideally, you shouldn't need to edit beyond this point
7372
@@ -78,9 +77,13 @@ INFOFILES= python-lib.info
7877PDFFILES = api.pdf ext.pdf lib.pdf tut.pdf
7978PSFILES = api.ps ext.ps lib.ps tut.ps
8079
80+ MANSTYLES =texinputs/fncychap.sty texinputs/manual.cls texinputs/python.sty
81+
8182# Main target
8283all : all-ps
8384
85+ world : all-ps all-pdf l2h lib.info tarballs
86+
8487all-dvi : $(DVIFILES )
8588all-pdf : $(PDFFILES )
8689all-ps : $(PSFILES )
@@ -121,13 +124,15 @@ tut-all: tut.dvi tut.pdf tut.ps l2htut
121124# This rule avoids creation of the intermediate PostScript files and uses
122125# only free software.
123126#
124- .dvi.pdf :
127+ .dvi.pdf : $* .bkm
128+ $(PYTHON ) tools/toc2bkm.py $*
125129 $(PDFLATEX ) $*
126130
127131# Dependencies
128- COMMONTEX =python.sty manual.cls copyright.tex boilerplate.tex
132+ COMMONTEX =$(MANSTYLES ) copyright.tex boilerplate.tex
133+ COMMONPERL =perl/manual.perl perl/python.perl
129134
130- $(DVIFILES ) : fix_hack $(COMMONTEX )
135+ $(DVIFILES ) : tools/ fix_hack $(COMMONTEX )
131136
132137# LaTeX source files for the Python Library Reference
133138LIBFILES = lib.tex \
@@ -163,14 +168,14 @@ LIBFILES = lib.tex \
163168 libframework.tex libminiae.tex libbinhex.tex libuu.tex libsunaudio.tex
164169
165170# Library document
166- lib.dvi : modindex.py indfix.py $(LIBFILES )
167- . /newind.py > $* .ind
168- . /newind.py modindex > mod$* .ind
171+ lib.dvi : tools/ modindex.py tools/ indfix.py $(LIBFILES )
172+ tools /newind.py > $* .ind
173+ tools /newind.py modindex > mod$* .ind
169174 $(LATEX ) $*
170- . /modindex.py mod$* .idx
171- . /fix_hack $* .idx
175+ tools /modindex.py mod$* .idx
176+ tools /fix_hack $* .idx
172177 $(MAKEINDEX ) $* .idx
173- . /indfix.py $* .ind
178+ tools /indfix.py $* .ind
174179 $(LATEX ) $*
175180
176181# Tutorial document
@@ -181,24 +186,16 @@ tut.dvi: tut.tex
181186# Extending & Embedding, Python/C API documents.
182187# Done this way to avoid repeated command sets.
183188.tex.dvi :
184- . /newind.py > $* .ind
189+ tools /newind.py > $* .ind
185190 $(LATEX ) $*
186- . /fix_hack $* .idx
191+ tools /fix_hack $* .idx
187192 $(MAKEINDEX ) $* .idx
188193 $(LATEX ) $*
189194
190195
191196# The remaining part of the Makefile is concerned with various
192197# conversions, as described above. See also the README file.
193198
194- .SUFFIXES : .py .pyc .pyo
195-
196- .py.pyo :
197- $(PYTHON ) -O -c " import $* "
198-
199- .py.pyc :
200- $(PYTHON ) -c " import $* "
201-
202199.PRECIOUS : python-lib.texi
203200
204201# The sed script in this target fixes a really nasty little condition in
@@ -207,13 +204,13 @@ tut.dvi: tut.tex
207204# least the info file gets generated.
208205
209206lib1.texi : $(LIBFILES ) texipre.dat texipost.dat $(PARTPARSEOBJ )
210- $(PARTPARSE ) -o $@ ` . /whichlibs`
207+ $(PARTPARSE ) -o $@ ` tools /whichlibs`
211208 sed ' s/"{\\}n{\\}n/"\\n\\n/' $@ > temp.texi
212209 mv temp.texi $@
213210
214- python-lib.texi : lib1.texi fix.el
211+ python-lib.texi : lib1.texi tools/ fix.el
215212 cp lib1.texi temp.texi
216- $(EMACS ) -batch -l fix.el -f save-buffer -kill
213+ $(EMACS ) -batch -l tools/ fix.el -f save-buffer -kill
217214 mv temp.texi $@
218215
219216python-lib.info : python-lib.texi
@@ -241,40 +238,43 @@ lib.texi: python-lib.texi
241238
242239l2h : l2hapi l2hext l2hlib l2htut
243240
244- l2htut : tut.dvi manual.perl python.perl
241+ l2htut : tut.dvi $( COMMONPERL )
245242 $(L2H ) $(L2HARGS ) tut.tex
246- (cd tut; ../node2label.pl * .html)
247- ln -s tut.html tut/index.html || true
243+ (cd tut; ../tools/node2label.pl * .html)
248244
249- l2hext : ext.dvi manual.perl python.perl
245+ l2hext : ext.dvi $( COMMONPERL )
250246 $(L2H ) $(L2HARGS ) ext.tex
251- (cd ext; ../node2label.pl * .html)
252- ln -s ext.html ext/index.html || true
247+ (cd ext; ../tools/node2label.pl * .html)
253248
254- l2hlib : lib.dvi manual.perl python.perl
255- . /fix_libaux.sed < lib.aux > lib1.aux
249+ l2hlib : lib.dvi $( COMMONPERL )
250+ tools /fix_libaux.sed < lib.aux > lib1.aux
256251 mv lib1.aux lib.aux
257- if [ -d lib ] ; then rm -f lib/* .html ; fi
252+ if test -d lib ; then rm -f lib/* .html ; fi
258253 $(L2H ) $(L2HARGS ) lib.tex
259- (cd lib; ../node2label.pl * .html)
260- ln -s lib.html lib/index.html || true
254+ (cd lib; ../tools/node2label.pl * .html)
261255
262- l2hapi : api.dvi manual.perl python.perl
256+ l2hapi : api.dvi $( COMMONPERL )
263257 $(L2H ) $(L2HARGS ) api.tex
264- (cd api; ../node2label.pl * .html)
265- ln -s api.html api/index.html || true
258+ (cd api; ../tools/node2label.pl * .html)
259+
260+ # webchecker needs an extra flag to process the huge index from the libref
261+ webcheck :
262+ $(WEBCHECKER ) file:` pwd` /api/
263+ $(WEBCHECKER ) file:` pwd` /ext/
264+ $(WEBCHECKER ) -m290000 file:` pwd` /lib/
265+ $(WEBCHECKER ) file:` pwd` /tut/
266266
267- info-$(VERSION ) .tar.gz : $(INFOFILES )
267+ lib- info-$(VERSION ) .tar.gz : $(INFOFILES )
268268 tar cf - python-??? .info* | gzip -9 > $@
269269
270270latex-$(VERSION ) .tar.gz :
271- . /mktarball.sh
271+ tools /mktarball.sh
272272
273273# This snags a PDF version if available, but doesn't fail if not.
274274pdf-$(VERSION ) .tar.gz : $(PDFFILES )
275- if [ -f ref/ref.pdf ] ; then cp ref/ref.pdf . ; else true ; fi
275+ if test -f ref/ref.pdf ; then cp ref/ref.pdf . ; else true ; fi
276276 tar cf - ??? .pdf | gzip -9 > $@
277- if [ -f ref.pdf ] ; then rm ref.pdf ; else true ; fi
277+ if test -f ref.pdf ; then rm ref.pdf ; else true ; fi
278278
279279postscript-$(VERSION ) .tar.gz : $(PSFILES ) ref/ref.ps
280280 cp ref/ref.ps .
@@ -288,7 +288,7 @@ tarhtml:
288288
289289# convenience targets:
290290
291- tarinfo : info-$(VERSION ) .tar.gz
291+ tarinfo : lib- info-$(VERSION ) .tar.gz
292292
293293tarps : postscript-$(VERSION ) .tar.gz
294294
@@ -304,7 +304,7 @@ tarballs: tarpdf tarps tarhtml tarinfo tarlatex
304304# Remove temporary files; all except the following:
305305# - sources: .tex, .bib, .sty, *.cls
306306# - useful results: .dvi, .pdf, .ps, .texi, .info
307- clean : l2hclean
307+ clean :
308308 rm -f @* * ~ * .aux * .idx * .ilg * .ind * .log * .toc * .blg * .bbl * .py[co]
309309 rm -f * .bak * .orig lib1.texi * .out
310310 rm -f html-$(VERSION ) .tar.gz info-$(VERSION ) .tar.gz
@@ -315,8 +315,8 @@ l2hclean:
315315 rm -rf api ext lib tut
316316
317317# Remove temporaries as well as final products
318- clobber : clean
319- rm -f * .dvi * .pdf * .ps * .texi * .info * .info-[0-9]*
318+ clobber : clean l2hclean
319+ rm -f * .dvi * .pdf * .ps * .texi python- * .info python- * .info-[0-9]*
320320
321321realclean : clobber
322322distclean : clobber
0 commit comments