blob: a1366857583eb1f9b2b4b9879ecd7b2d4af8e164 [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)
Guido van Rossume83e3801995-03-17 16:01:35 +00009# ext -- Extending and Embedding (file ext.tex)
Guido van Rossum9231c8f1997-05-15 21:43:21 +000010# api -- Python-C API Reference
Guido van Rossume83e3801995-03-17 16:01:35 +000011#
Guido van Rossum1f175431996-10-22 20:00:02 +000012# The Reference Manual is now maintained as a FrameMaker document.
13# See the subdirectory ref; PostScript is included as ref/ref.ps.
14# (In the future, the Tutorial will also be converted to FrameMaker;
15# the other documents will be maintained in a text format such
16# as LaTeX or perhaps TIM.)
17#
Guido van Rossume83e3801995-03-17 16:01:35 +000018# The main target "make all" creates DVI and PostScript for these
19# four. You can also do "make lib" (etc.) to process individual
20# documents.
21#
Guido van Rossume83e3801995-03-17 16:01:35 +000022# There's one local style file: myformat.sty. This defines a number
23# of macros that are similar in name and intent as macros in Texinfo
24# (e.g. \code{...} and \emph{...}), as well as a number of
25# environments for formatting function and data definitions, also in
26# the style of Texinfo.
27#
28# Everything is processed by LaTeX. The following tools are used:
29# latex
30# makeindex
31# dvips
Guido van Rossume83e3801995-03-17 16:01:35 +000032#
33# There's a problem with generating the index which has been solved by
34# a sed command applied to the index file. The shell script fix_hack
35# does this (the Makefile takes care of calling it).
36#
37# To preview the dvi files produced by LaTeX it would be useful to
38# have xdvi as well.
39#
40# Additional targets attempt to convert selected LaTeX sources to
41# various other formats. These are generally site specific because
42# the tools used are all but universal. These targets are:
Guido van Rossum9231c8f1997-05-15 21:43:21 +000043# l2h -- convert tut, lib, ext, api from LaTeX to HTML
Guido van Rossum73827c61995-03-20 13:00:32 +000044# See the README file for more info on these targets.
Guido van Rossume83e3801995-03-17 16:01:35 +000045
Guido van Rossum73827c61995-03-20 13:00:32 +000046# Customizations -- you *may* have to edit these
Guido van Rossume83e3801995-03-17 16:01:35 +000047
Guido van Rossum73827c61995-03-20 13:00:32 +000048# Where are the various programs?
49LATEX= latex
50BIBTEX= bibtex
Guido van Rossum73827c61995-03-20 13:00:32 +000051DVIPS= dvips -f
52MAKEINDEX= makeindex
Fred Drakef93f1011996-10-29 16:07:46 +000053L2H= latex2html
Fred Drakeb4d4e251996-11-11 21:03:01 +000054L2HARGS= -address $$USER@`domainname`
Guido van Rossum73827c61995-03-20 13:00:32 +000055
56# Install destination -- not used now but might be useful some time...
57DESTDIR= /usr/local
58LIBDESTDIR= $DESTDIR/lib
59LIBDEST= $LIBDESTDIR/python
60DOCDESTDIR= $LIBDEST/doc
61
62# Ideally, you shouldn't need to edit beyond this point
Guido van Rossum5b343731992-07-07 09:06:34 +000063
Guido van Rossume83e3801995-03-17 16:01:35 +000064# Main target
Guido van Rossumeb8d5031996-08-09 21:46:05 +000065all: all-ps
66
Guido van Rossum9231c8f1997-05-15 21:43:21 +000067all-dvi: tut.dvi lib.dvi ext.dvi api.dvi
68all-ps: tut.ps lib.ps ext.ps api.ps
Guido van Rossum20aca5a1991-01-25 13:29:04 +000069
Guido van Rossume83e3801995-03-17 16:01:35 +000070# Individual document fake targets
Guido van Rossumeb8d5031996-08-09 21:46:05 +000071tut: tut.ps
72lib: lib.ps
Guido van Rossumeb8d5031996-08-09 21:46:05 +000073ext: ext.ps
Guido van Rossum9231c8f1997-05-15 21:43:21 +000074api: api.ps
Guido van Rossume83e3801995-03-17 16:01:35 +000075
76# Dependencies
Guido van Rossum9231c8f1997-05-15 21:43:21 +000077tut.dvi lib.dvi ext.dvi api.dvi: myformat.sty fix_hack
Guido van Rossum16d6e711994-08-08 12:30:22 +000078
Guido van Rossume83e3801995-03-17 16:01:35 +000079# Tutorial document
Guido van Rossum16d6e711994-08-08 12:30:22 +000080tut.dvi: tut.tex
Guido van Rossum73827c61995-03-20 13:00:32 +000081 $(LATEX) tut
82 $(LATEX) tut
Guido van Rossumeb8d5031996-08-09 21:46:05 +000083
84tut.ps: tut.dvi
Guido van Rossum6938f061994-08-01 12:22:53 +000085 $(DVIPS) tut >tut.ps
Guido van Rossumb3fa13c1991-01-22 11:47:14 +000086
Guido van Rossum16d6e711994-08-08 12:30:22 +000087# LaTeX source files for the Python Library Reference
88LIBFILES = lib.tex \
Guido van Rossum40006cf1996-08-19 22:58:03 +000089 libintro.tex libobjs.tex libtypes.tex libexcs.tex libfuncs.tex \
90 libpython.tex libsys.tex libtypes2.tex libtraceback.tex libpickle.tex \
91 libshelve.tex libcopy.tex libmarshal.tex libimp.tex libparser.tex \
92 libbltin.tex libmain.tex libstrings.tex libstring.tex libregex.tex \
93 libregsub.tex libstruct.tex libmisc.tex libmath.tex librand.tex \
94 libwhrandom.tex libarray.tex liballos.tex libos.tex libtime.tex \
95 libgetopt.tex libtempfile.tex liberrno.tex libsomeos.tex libsignal.tex \
96 libsocket.tex libselect.tex libthread.tex libunix.tex libposix.tex \
97 libppath.tex libpwd.tex libgrp.tex libcrypt.tex libdbm.tex libgdbm.tex \
98 libtermios.tex libfcntl.tex libposixfile.tex libsyslog.tex libpdb.tex \
99 libprofile.tex libwww.tex libcgi.tex liburllib.tex libhttplib.tex \
100 libftplib.tex libgopherlib.tex libnntplib.tex liburlparse.tex \
101 libhtmllib.tex libsgmllib.tex librfc822.tex libmimetools.tex \
102 libbinascii.tex libmm.tex libaudioop.tex libimageop.tex libaifc.tex \
103 libjpeg.tex librgbimg.tex libcrypto.tex libmd5.tex libmpz.tex \
104 librotor.tex libmac.tex libctb.tex libmacconsole.tex libmacdnr.tex \
105 libmacfs.tex libmacos.tex libmacostools.tex libmactcp.tex \
106 libmacspeech.tex libmacui.tex libstdwin.tex libsgi.tex libal.tex \
107 libcd.tex libfl.tex libfm.tex libgl.tex libimgfile.tex libsun.tex \
Guido van Rossuma80c3981996-10-22 01:12:13 +0000108 libxdrlib.tex libimghdr.tex \
109 librestricted.tex librexec.tex libbastion.tex \
Guido van Rossum3dd68d31996-12-31 02:24:54 +0000110 libformatter.tex liboperator.tex libsoundex.tex libresource.tex \
Guido van Rossum7f3b0421997-03-27 14:56:18 +0000111 libstat.tex libstrio.tex libundoc.tex libmailcap.tex libglob.tex \
Guido van Rossume76b7a81997-04-27 21:25:52 +0000112 libuser.tex libanydbm.tex librandom.tex libsite.tex libwhichdb.tex \
Guido van Rossumdfb41201997-04-30 19:40:10 +0000113 libbase64.tex libfnmatch.tex libquopri.tex libzlib.tex
Guido van Rossum16d6e711994-08-08 12:30:22 +0000114
Guido van Rossume83e3801995-03-17 16:01:35 +0000115# Library document
Guido van Rossum16d6e711994-08-08 12:30:22 +0000116lib.dvi: $(LIBFILES)
Guido van Rossumb83241c1992-03-06 10:56:42 +0000117 touch lib.ind
Guido van Rossum73827c61995-03-20 13:00:32 +0000118 $(LATEX) lib
Guido van Rossum95cd2ef1992-12-08 14:37:55 +0000119 ./fix_hack lib.idx
Fred Drakeb4d4e251996-11-11 21:03:01 +0000120 $(MAKEINDEX) lib.idx
Guido van Rossum73827c61995-03-20 13:00:32 +0000121 $(LATEX) lib
Guido van Rossumeb8d5031996-08-09 21:46:05 +0000122
123lib.ps: lib.dvi
Guido van Rossum6938f061994-08-01 12:22:53 +0000124 $(DVIPS) lib >lib.ps
Guido van Rossuma52117e1991-11-21 13:54:36 +0000125
Guido van Rossume83e3801995-03-17 16:01:35 +0000126# Extensions document
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000127ext.dvi: ext.tex
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000128 touch ext.ind
Guido van Rossum73827c61995-03-20 13:00:32 +0000129 $(LATEX) ext
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000130 ./fix_hack ext.idx
Fred Drakeb4d4e251996-11-11 21:03:01 +0000131 $(MAKEINDEX) ext.idx
Guido van Rossum73827c61995-03-20 13:00:32 +0000132 $(LATEX) ext
Guido van Rossumeb8d5031996-08-09 21:46:05 +0000133
134ext.ps: ext.dvi
Guido van Rossum6938f061994-08-01 12:22:53 +0000135 $(DVIPS) ext >ext.ps
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000136
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000137# Python-C API document
138api.dvi: api.tex
139 touch api.ind
140 $(LATEX) api
141 ./fix_hack api.idx
142 $(MAKEINDEX) api.idx
143 $(LATEX) api
Guido van Rossumeb8d5031996-08-09 21:46:05 +0000144
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000145api.ps: api.dvi
146 $(DVIPS) api >api.ps
Guido van Rossumb3fa13c1991-01-22 11:47:14 +0000147
Guido van Rossume83e3801995-03-17 16:01:35 +0000148
149# The remaining part of the Makefile is concerned with various
Guido van Rossum73827c61995-03-20 13:00:32 +0000150# conversions, as described above. See also the README file.
Guido van Rossume83e3801995-03-17 16:01:35 +0000151
Guido van Rossum73827c61995-03-20 13:00:32 +0000152# Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
153# HTML converter. For more info on this program, see
Guido van Rossume83e3801995-03-17 16:01:35 +0000154# <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
Guido van Rossume83e3801995-03-17 16:01:35 +0000155
Fred Drakeb4d4e251996-11-11 21:03:01 +0000156# Note that LaTeX2HTML inserts references to an "icons" directory in
157# each page that it generates. You can customize where these icons
158# are to be found; I generally make it point to "../icons" and then
159# create a symbolic link to the icons directory in the LaTeX2HTML
160# source at the appropriate place. Change the definition of
161# $ICONSERVER in .latex2html-init to point to a different location.
Guido van Rossume83e3801995-03-17 16:01:35 +0000162
Fred Drakefc8f6f31996-12-06 18:45:30 +0000163# The sed hack rips out a superfluous comma which I haven't found the source
164# of; the prominent location makes it worth the extra step. This affects the
165# title pages!
166
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000167l2h: l2htut l2hext l2hlib l2htut
Guido van Rossum6938f061994-08-01 12:22:53 +0000168
Fred Drakeb4d4e251996-11-11 21:03:01 +0000169l2htut: tut.dvi myformat.perl
Guido van Rossum6938f061994-08-01 12:22:53 +0000170 $(L2H) $(L2HARGS) tut.tex
171 @rm -rf python-tut
Fred Drakefc8f6f31996-12-06 18:45:30 +0000172 sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \
173 <tut/tut.html >tut/xxx
174 mv tut/xxx tut/tut.html
Fred Draked5606051996-12-06 20:06:37 +0000175 ln -s tut.html tut/index.html
Guido van Rossum6938f061994-08-01 12:22:53 +0000176 mv tut python-tut
177
Fred Drakeb4d4e251996-11-11 21:03:01 +0000178l2hext: ext.dvi myformat.perl
Guido van Rossum6938f061994-08-01 12:22:53 +0000179 $(L2H) $(L2HARGS) ext.tex
180 @rm -rf python-ext
Fred Drakefc8f6f31996-12-06 18:45:30 +0000181 sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \
182 <ext/ext.html >ext/xxx
Fred Draked5606051996-12-06 20:06:37 +0000183 ln -s ext.html ext/index.html
Fred Drakefc8f6f31996-12-06 18:45:30 +0000184 mv ext/xxx ext/ext.html
Guido van Rossum6938f061994-08-01 12:22:53 +0000185 mv ext python-ext
Guido van Rossum970871f1993-02-21 20:10:26 +0000186
Fred Drakeb4d4e251996-11-11 21:03:01 +0000187l2hlib: lib.dvi myformat.perl
188 ./fix_libaux.sed <lib.aux >@lib.aux
189 mv @lib.aux lib.aux
Guido van Rossume83e3801995-03-17 16:01:35 +0000190 $(L2H) $(L2HARGS) lib.tex
Fred Drakef1e67071996-12-06 15:11:34 +0000191 sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \
192 <lib/lib.html >lib/xxx
193 mv lib/xxx lib/lib.html
Fred Draked5606051996-12-06 20:06:37 +0000194 ln -s lib.html lib/index.html
Guido van Rossume83e3801995-03-17 16:01:35 +0000195 @rm -rf python-lib
196 mv lib python-lib
197
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000198l2hapi: api.dvi myformat.perl
199 $(L2H) $(L2HARGS) api.tex
200 @rm -rf python-api
201 sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \
202 <api/api.html >api/xxx
203 ln -s api.html api/index.html
204 mv api/xxx api/api.html
205 mv api python-api
206
Guido van Rossume83e3801995-03-17 16:01:35 +0000207
208# Housekeeping targets
209
Guido van Rossum9231c8f1997-05-15 21:43:21 +0000210# Remove temporary files; all except the following:
211# - sources: .tex, .bib, .sty
212# - useful results: .dvi, .ps, .texi, .info
Guido van Rossum7f777ed1990-08-09 14:25:15 +0000213clean:
Guido van Rossum4ac605e1992-12-17 15:31:02 +0000214 rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc
Guido van Rossume83e3801995-03-17 16:01:35 +0000215 rm -f *.bak *.orig
Guido van Rossum5b343731992-07-07 09:06:34 +0000216
Guido van Rossume83e3801995-03-17 16:01:35 +0000217# Remove temporaries as well as final products
Guido van Rossum5b343731992-07-07 09:06:34 +0000218clobber: clean
Guido van Rossum7a2dba21993-11-05 14:45:11 +0000219 rm -f *.dvi *.ps *.texi *.info *.info-[0-9]*