blob: 57ec616f9d65a320181e431d24243ed08382addd [file] [log] [blame]
Guido van Rossume83e3801995-03-17 16:01:35 +00001# Makefile for Python documentation
2# ---------------------------------
3#
Guido van Rossum73827c61995-03-20 13:00:32 +00004# See also the README file.
5#
Guido van Rossume83e3801995-03-17 16:01:35 +00006# This is a bit of a mess. The main documents are:
7# tut -- Tutorial (file tut.tex)
8# lib -- Library Reference (file lib.tex, inputs lib*.tex)
9# ref -- Language Reference (file ref.tex, inputs ref*.tex)
10# ext -- Extending and Embedding (file ext.tex)
11#
12# The main target "make all" creates DVI and PostScript for these
13# four. You can also do "make lib" (etc.) to process individual
14# documents.
15#
16# There's also:
17# qua -- Paper published in the CWI Quarterly (file qua.tex)
18#
19# There's one local style file: myformat.sty. This defines a number
20# of macros that are similar in name and intent as macros in Texinfo
21# (e.g. \code{...} and \emph{...}), as well as a number of
22# environments for formatting function and data definitions, also in
23# the style of Texinfo.
24#
25# Everything is processed by LaTeX. The following tools are used:
26# latex
27# makeindex
28# dvips
29# bibtex (only for formatting qua.tex)
30#
31# There's a problem with generating the index which has been solved by
32# a sed command applied to the index file. The shell script fix_hack
33# does this (the Makefile takes care of calling it).
34#
35# To preview the dvi files produced by LaTeX it would be useful to
36# have xdvi as well.
37#
38# Additional targets attempt to convert selected LaTeX sources to
39# various other formats. These are generally site specific because
40# the tools used are all but universal. These targets are:
41# l2h -- convert tut, ref, ext (but not lib!) from LaTeX to HTML
42# lib.texi -- convert lib from LaTeX to Texinfo
43# lib.info -- convert lib from Texinfo to Emacs INFO
44# libwww -- convert lib from Texinfo to HTML
Guido van Rossum73827c61995-03-20 13:00:32 +000045# See the README file for more info on these targets.
Guido van Rossume83e3801995-03-17 16:01:35 +000046
Guido van Rossum73827c61995-03-20 13:00:32 +000047# Customizations -- you *may* have to edit these
Guido van Rossume83e3801995-03-17 16:01:35 +000048
Guido van Rossum73827c61995-03-20 13:00:32 +000049# Where are the various programs?
50LATEX= latex
51BIBTEX= bibtex
52EMACS= emacs
53DVIPS= dvips -f
54MAKEINDEX= makeindex
55PYTHON= python
56MAKEINFO= makeinfo
57L2H= /ufs/guido/l2h/latex2html
58L2HARGS= -address $$USER@`domainname` -dont_include myformat
59
60# Install destination -- not used now but might be useful some time...
61DESTDIR= /usr/local
62LIBDESTDIR= $DESTDIR/lib
63LIBDEST= $LIBDESTDIR/python
64DOCDESTDIR= $LIBDEST/doc
65
66# Ideally, you shouldn't need to edit beyond this point
Guido van Rossum5b343731992-07-07 09:06:34 +000067
Guido van Rossume83e3801995-03-17 16:01:35 +000068# Main target
Guido van Rossum16d6e711994-08-08 12:30:22 +000069all: tut.dvi lib.dvi ref.dvi ext.dvi
Guido van Rossum20aca5a1991-01-25 13:29:04 +000070
Guido van Rossume83e3801995-03-17 16:01:35 +000071# Individual document fake targets
Guido van Rossum16d6e711994-08-08 12:30:22 +000072tut: tut.dvi
Guido van Rossum16d6e711994-08-08 12:30:22 +000073lib: lib.dvi
Guido van Rossume83e3801995-03-17 16:01:35 +000074ref: ref.dvi
75ext: ext.dvi
Guido van Rossum16d6e711994-08-08 12:30:22 +000076
Guido van Rossume83e3801995-03-17 16:01:35 +000077# CWI Quarterly document fake target
78qua: qua.dvi
79
80# Dependencies
Guido van Rossum16d6e711994-08-08 12:30:22 +000081tut.dvi lib.dvi ref.dvi ext.dvi: myformat.sty fix_hack
82
Guido van Rossume83e3801995-03-17 16:01:35 +000083# Tutorial document
Guido van Rossum16d6e711994-08-08 12:30:22 +000084tut.dvi: tut.tex
Guido van Rossum73827c61995-03-20 13:00:32 +000085 $(LATEX) tut
86 $(LATEX) tut
Guido van Rossum6938f061994-08-01 12:22:53 +000087 $(DVIPS) tut >tut.ps
Guido van Rossumb3fa13c1991-01-22 11:47:14 +000088
Guido van Rossume83e3801995-03-17 16:01:35 +000089# Reference document
Guido van Rossum16d6e711994-08-08 12:30:22 +000090ref.dvi: ref.tex ref1.tex ref2.tex ref3.tex ref4.tex ref5.tex ref6.tex \
91 ref7.tex ref8.tex
Guido van Rossumb83241c1992-03-06 10:56:42 +000092 touch ref.ind
Guido van Rossum73827c61995-03-20 13:00:32 +000093 $(LATEX) ref
Guido van Rossum4ac605e1992-12-17 15:31:02 +000094 ./fix_hack ref.idx
Guido van Rossum73827c61995-03-20 13:00:32 +000095 $(MAKEINDEX) ref
96 $(LATEX) ref
Guido van Rossum6938f061994-08-01 12:22:53 +000097 $(DVIPS) ref >ref.ps
Guido van Rossumb3fa13c1991-01-22 11:47:14 +000098
Guido van Rossum16d6e711994-08-08 12:30:22 +000099# LaTeX source files for the Python Library Reference
100LIBFILES = lib.tex \
Guido van Rossum817a8421995-02-16 16:28:22 +0000101libal.tex libaifc.tex libamoeba.tex libarray.tex libaudio.tex libaudioop.tex \
Guido van Rossum16d6e711994-08-08 12:30:22 +0000102libbltin.tex \
Sjoerd Mullenderffd6de11995-03-28 11:56:52 +0000103libcd.tex \
Guido van Rossumdc46c7f1995-03-01 15:38:16 +0000104libcgi.tex libcopy.tex libctb.tex libcrypto.tex \
Guido van Rossum16d6e711994-08-08 12:30:22 +0000105libdbm.tex \
106libexcs.tex \
Guido van Rossuma12ef941995-02-27 17:53:25 +0000107libfcntl.tex libfl.tex libfm.tex libftplib.tex libfuncs.tex \
108libgdbm.tex libgetopt.tex libgl.tex libgopherlib.tex libgrp.tex \
109libhtmllib.tex libhttplib.tex \
Guido van Rossum16d6e711994-08-08 12:30:22 +0000110libimageop.tex libimgfile.tex libintro.tex \
111libjpeg.tex \
Guido van Rossum85c4ff21995-03-07 10:12:11 +0000112libmac.tex libmacconsole.tex libmacdnr.tex \
113 libmacfs.tex libmactcp.tex libmacspeech.tex \
114 libmain.tex libmarshal.tex libmath.tex \
Guido van Rossuma12ef941995-02-27 17:53:25 +0000115 libmd5.tex libmimetools.tex libmm.tex libmods.tex libmpz.tex \
116libnntplib.tex \
Guido van Rossum16d6e711994-08-08 12:30:22 +0000117libobjs.tex libos.tex \
Guido van Rossumdf804f81995-03-02 12:38:39 +0000118libpanel.tex libpickle.tex libposix.tex libposixfile.tex \
119 libppath.tex libprofile.tex libpwd.tex \
Guido van Rossuma12ef941995-02-27 17:53:25 +0000120librand.tex libregex.tex libregsub.tex \
121 librfc822.tex librgbimg.tex librotor.tex \
122libselect.tex libsgi.tex libsgmllib.tex \
123 libshelve.tex libsocket.tex libstd.tex libstdwin.tex \
Guido van Rossum16d6e711994-08-08 12:30:22 +0000124 libstring.tex libstruct.tex libsun.tex libsys.tex \
Guido van Rossumdc46c7f1995-03-01 15:38:16 +0000125libtempfile.tex libthread.tex libtime.tex \
126 libtraceback.tex libtypes.tex libtypes2.tex \
Guido van Rossuma12ef941995-02-27 17:53:25 +0000127libunix.tex liburllib.tex liburlparse.tex \
Guido van Rossum817a8421995-02-16 16:28:22 +0000128libwhrandom.tex libwww.tex
Guido van Rossum16d6e711994-08-08 12:30:22 +0000129
Guido van Rossume83e3801995-03-17 16:01:35 +0000130# Library document
Guido van Rossum16d6e711994-08-08 12:30:22 +0000131lib.dvi: $(LIBFILES)
Guido van Rossumb83241c1992-03-06 10:56:42 +0000132 touch lib.ind
Guido van Rossum73827c61995-03-20 13:00:32 +0000133 $(LATEX) lib
Guido van Rossum95cd2ef1992-12-08 14:37:55 +0000134 ./fix_hack lib.idx
Guido van Rossum73827c61995-03-20 13:00:32 +0000135 $(MAKEINDEX) lib
136 $(LATEX) lib
Guido van Rossum6938f061994-08-01 12:22:53 +0000137 $(DVIPS) lib >lib.ps
Guido van Rossuma52117e1991-11-21 13:54:36 +0000138
Guido van Rossume83e3801995-03-17 16:01:35 +0000139# Extensions document
Guido van Rossum16d6e711994-08-08 12:30:22 +0000140ext.dvi: ext.tex
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000141 touch ext.ind
Guido van Rossum73827c61995-03-20 13:00:32 +0000142 $(LATEX) ext
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000143 ./fix_hack ext.idx
Guido van Rossum73827c61995-03-20 13:00:32 +0000144 $(MAKEINDEX) ext
145 $(LATEX) ext
Guido van Rossum6938f061994-08-01 12:22:53 +0000146 $(DVIPS) ext >ext.ps
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000147
Guido van Rossume83e3801995-03-17 16:01:35 +0000148# Quarterly document
Guido van Rossum16d6e711994-08-08 12:30:22 +0000149qua.dvi: qua.tex quabib.bib
Guido van Rossum73827c61995-03-20 13:00:32 +0000150 $(LATEX) qua
151 $(BIBTEX) qua
152 $(LATEX) qua
153 $(BIBTEX) qua
Guido van Rossum6938f061994-08-01 12:22:53 +0000154 $(DVIPS) qua >qua.ps
Guido van Rossumb3fa13c1991-01-22 11:47:14 +0000155
Guido van Rossume83e3801995-03-17 16:01:35 +0000156
157# The remaining part of the Makefile is concerned with various
Guido van Rossum73827c61995-03-20 13:00:32 +0000158# conversions, as described above. See also the README file.
Guido van Rossume83e3801995-03-17 16:01:35 +0000159
Guido van Rossum6938f061994-08-01 12:22:53 +0000160lib.texi: lib*.tex texipre.dat texipost.dat partparse.py fix.el
Guido van Rossum73827c61995-03-20 13:00:32 +0000161 $(PYTHON) partparse.py -o @lib.texi `./whichlibs`
162 $(EMACS) -batch -l fix.el -f save-buffer -kill
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000163 mv @lib.texi lib.texi
Guido van Rossum95cd2ef1992-12-08 14:37:55 +0000164
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000165.PRECIOUS: lib.texi
166
Guido van Rossum6938f061994-08-01 12:22:53 +0000167python-lib.info: lib.texi
Guido van Rossum73827c61995-03-20 13:00:32 +0000168 -$(MAKEINFO) --footnote-style end --fill-column 72 \
169 --paragraph-indent 0 lib.texi
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000170
171lib.info: python-lib.info
172
173# This target is very local to CWI...
174libwww: lib.texi
Guido van Rossum73827c61995-03-20 13:00:32 +0000175 $(PYTHON) texi2html.py -d lib.texi /ufs/guido/public_html/python-lib
Guido van Rossum6938f061994-08-01 12:22:53 +0000176
Guido van Rossum73827c61995-03-20 13:00:32 +0000177# Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
178# HTML converter. For more info on this program, see
Guido van Rossume83e3801995-03-17 16:01:35 +0000179# <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
180# (I've had some trouble getting this to work with the netpbm version
181# of the pbmplus library; ppmtogif dumped core because giftopnm
182# outputs bitmap (pbm) files. I've fixed this by changing the source
183# of LaTeX2HTML to insert a call to pnmtoppm, which I wrote myself.
184# You can probably also use "pbmtopgm | pgmtoppm"...
185
186# In order to use these targets, you must edit the definition of L2H
Guido van Rossum73827c61995-03-20 13:00:32 +0000187# earlier in the Makefile to point to the latex2html program. Note
188# that LaTeX2HTML inserts references to an "icons" directory in each
189# page that it generates. You can customize where these icons are to
190# be found; I generally make it point to "../icons" and then create a
Guido van Rossume83e3801995-03-17 16:01:35 +0000191# symbolic link to the icons directory in the LaTeX2HTML source at the
192# appropriate place.
193
Guido van Rossum6938f061994-08-01 12:22:53 +0000194l2h: l2htut l2href l2hext
195
196l2htut: tut
197 $(L2H) $(L2HARGS) tut.tex
198 @rm -rf python-tut
199 mv tut python-tut
200
201l2href: ref
202 $(L2H) $(L2HARGS) ref.tex
203 @rm -rf python-ref
204 mv ref python-ref
205
206l2hext: ext
207 $(L2H) $(L2HARGS) ext.tex
208 @rm -rf python-ext
209 mv ext python-ext
Guido van Rossum970871f1993-02-21 20:10:26 +0000210
Guido van Rossume83e3801995-03-17 16:01:35 +0000211# This target doesn't quite work, since l2h doesn't understand the
212# funcdesc and similar environments, and turns them into GIF images.
213# Use the "libwww" target above instead.
214l2hlib: lib
215 $(L2H) $(L2HARGS) lib.tex
216 @rm -rf python-lib
217 mv lib python-lib
218
219
220# Housekeeping targets
221
222# Remove temporary files
Guido van Rossum7f777ed1990-08-09 14:25:15 +0000223clean:
Guido van Rossum4ac605e1992-12-17 15:31:02 +0000224 rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc
Guido van Rossume83e3801995-03-17 16:01:35 +0000225 rm -f *.bak *.orig
Guido van Rossum5b343731992-07-07 09:06:34 +0000226 # Sources: .tex, .bib, .sty
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000227 # Useful results: .dvi, .ps, .texi, .info
Guido van Rossum5b343731992-07-07 09:06:34 +0000228
Guido van Rossume83e3801995-03-17 16:01:35 +0000229# Remove temporaries as well as final products
Guido van Rossum5b343731992-07-07 09:06:34 +0000230clobber: clean
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000231 rm -f *.dvi *.ps *.texi *.info *.info-[0-9]*