| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 1 | # Makefile for Python documentation | 
|  | 2 | # --------------------------------- | 
|  | 3 | # | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 4 | # See also the README file. | 
|  | 5 | # | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 6 | # 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 Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 45 | # See the README file for more info on these targets. | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 46 |  | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 47 | # Customizations -- you *may* have to edit these | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 48 |  | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 49 | # Where are the various programs? | 
|  | 50 | LATEX=		latex | 
|  | 51 | BIBTEX=		bibtex | 
|  | 52 | EMACS=		emacs | 
|  | 53 | DVIPS=		dvips -f | 
|  | 54 | MAKEINDEX=	makeindex | 
|  | 55 | PYTHON=		python | 
|  | 56 | MAKEINFO=	makeinfo | 
|  | 57 | L2H=		/ufs/guido/l2h/latex2html | 
|  | 58 | L2HARGS=	-address $$USER@`domainname` -dont_include myformat | 
|  | 59 |  | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 60 | # Destination directory for output of libwww target. | 
|  | 61 | LIBHTMLDIR=	./python-lib | 
|  | 62 |  | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 63 | # Install destination -- not used now but might be useful some time... | 
|  | 64 | DESTDIR=	/usr/local | 
|  | 65 | LIBDESTDIR=	$DESTDIR/lib | 
|  | 66 | LIBDEST=	$LIBDESTDIR/python | 
|  | 67 | DOCDESTDIR=	$LIBDEST/doc | 
|  | 68 |  | 
|  | 69 | # Ideally, you shouldn't need to edit beyond this point | 
| Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 70 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 71 | # Main target | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 72 | all:	all-ps | 
|  | 73 |  | 
|  | 74 | all-dvi: tut.dvi lib.dvi ref.dvi ext.dvi | 
|  | 75 | all-ps:	tut.ps lib.ps ref.ps ext.ps | 
| Guido van Rossum | 20aca5a | 1991-01-25 13:29:04 +0000 | [diff] [blame] | 76 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 77 | # Individual document fake targets | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 78 | tut:	tut.ps | 
|  | 79 | lib:	lib.ps | 
|  | 80 | ref:	ref.ps | 
|  | 81 | ext:	ext.ps | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 82 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 83 | # CWI Quarterly document fake target | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 84 | qua:	qua.ps | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 85 |  | 
|  | 86 | # Dependencies | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 87 | tut.dvi lib.dvi ref.dvi ext.dvi: myformat.sty fix_hack | 
|  | 88 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 89 | # Tutorial document | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 90 | tut.dvi: tut.tex | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 91 | $(LATEX) tut | 
|  | 92 | $(LATEX) tut | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 93 |  | 
|  | 94 | tut.ps:	tut.dvi | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 95 | $(DVIPS) tut >tut.ps | 
| Guido van Rossum | b3fa13c | 1991-01-22 11:47:14 +0000 | [diff] [blame] | 96 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 97 | # Reference document | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 98 | ref.dvi: ref.tex ref1.tex ref2.tex ref3.tex ref4.tex ref5.tex ref6.tex \ | 
|  | 99 | ref7.tex ref8.tex | 
| Guido van Rossum | b83241c | 1992-03-06 10:56:42 +0000 | [diff] [blame] | 100 | touch ref.ind | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 101 | $(LATEX) ref | 
| Guido van Rossum | 4ac605e | 1992-12-17 15:31:02 +0000 | [diff] [blame] | 102 | ./fix_hack ref.idx | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 103 | $(MAKEINDEX) ref | 
|  | 104 | $(LATEX) ref | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 105 |  | 
|  | 106 | ref.ps:	ref.dvi | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 107 | $(DVIPS) ref >ref.ps | 
| Guido van Rossum | b3fa13c | 1991-01-22 11:47:14 +0000 | [diff] [blame] | 108 |  | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 109 | # LaTeX source files for the Python Library Reference | 
|  | 110 | LIBFILES = lib.tex \ | 
| Guido van Rossum | 40006cf | 1996-08-19 22:58:03 +0000 | [diff] [blame^] | 111 | libintro.tex libobjs.tex libtypes.tex libexcs.tex libfuncs.tex \ | 
|  | 112 | libpython.tex libsys.tex libtypes2.tex libtraceback.tex libpickle.tex \ | 
|  | 113 | libshelve.tex libcopy.tex libmarshal.tex libimp.tex libparser.tex \ | 
|  | 114 | libbltin.tex libmain.tex libstrings.tex libstring.tex libregex.tex \ | 
|  | 115 | libregsub.tex libstruct.tex libmisc.tex libmath.tex librand.tex \ | 
|  | 116 | libwhrandom.tex libarray.tex liballos.tex libos.tex libtime.tex \ | 
|  | 117 | libgetopt.tex libtempfile.tex liberrno.tex libsomeos.tex libsignal.tex \ | 
|  | 118 | libsocket.tex libselect.tex libthread.tex libunix.tex libposix.tex \ | 
|  | 119 | libppath.tex libpwd.tex libgrp.tex libcrypt.tex libdbm.tex libgdbm.tex \ | 
|  | 120 | libtermios.tex libfcntl.tex libposixfile.tex libsyslog.tex libpdb.tex \ | 
|  | 121 | libprofile.tex libwww.tex libcgi.tex liburllib.tex libhttplib.tex \ | 
|  | 122 | libftplib.tex libgopherlib.tex libnntplib.tex liburlparse.tex \ | 
|  | 123 | libhtmllib.tex libsgmllib.tex librfc822.tex libmimetools.tex \ | 
|  | 124 | libbinascii.tex libmm.tex libaudioop.tex libimageop.tex libaifc.tex \ | 
|  | 125 | libjpeg.tex librgbimg.tex libcrypto.tex libmd5.tex libmpz.tex \ | 
|  | 126 | librotor.tex libmac.tex libctb.tex libmacconsole.tex libmacdnr.tex \ | 
|  | 127 | libmacfs.tex libmacos.tex libmacostools.tex libmactcp.tex \ | 
|  | 128 | libmacspeech.tex libmacui.tex libstdwin.tex libsgi.tex libal.tex \ | 
|  | 129 | libcd.tex libfl.tex libfm.tex libgl.tex libimgfile.tex libsun.tex \ | 
|  | 130 | libxdrlib.tex libimghdr.tex | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 131 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 132 | # Library document | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 133 | lib.dvi: $(LIBFILES) | 
| Guido van Rossum | b83241c | 1992-03-06 10:56:42 +0000 | [diff] [blame] | 134 | touch lib.ind | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 135 | $(LATEX) lib | 
| Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 136 | ./fix_hack lib.idx | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 137 | $(MAKEINDEX) lib | 
|  | 138 | $(LATEX) lib | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 139 |  | 
|  | 140 | lib.ps:	lib.dvi | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 141 | $(DVIPS) lib >lib.ps | 
| Guido van Rossum | a52117e | 1991-11-21 13:54:36 +0000 | [diff] [blame] | 142 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 143 | # Extensions document | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 144 | ext.dvi: ext.tex | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 145 | touch ext.ind | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 146 | $(LATEX) ext | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 147 | ./fix_hack ext.idx | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 148 | $(MAKEINDEX) ext | 
|  | 149 | $(LATEX) ext | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 150 |  | 
|  | 151 | ext.ps:	ext.dvi | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 152 | $(DVIPS) ext >ext.ps | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 153 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 154 | # Quarterly document | 
| Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 155 | qua.dvi: qua.tex quabib.bib | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 156 | $(LATEX) qua | 
|  | 157 | $(BIBTEX) qua | 
|  | 158 | $(LATEX) qua | 
|  | 159 | $(BIBTEX) qua | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 160 |  | 
|  | 161 | qua.ps:	qua.dvi | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 162 | $(DVIPS) qua >qua.ps | 
| Guido van Rossum | b3fa13c | 1991-01-22 11:47:14 +0000 | [diff] [blame] | 163 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 164 |  | 
|  | 165 | # The remaining part of the Makefile is concerned with various | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 166 | # conversions, as described above.  See also the README file. | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 167 |  | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 168 | lib.texi: lib*.tex texipre.dat texipost.dat partparse.py fix.el | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 169 | $(PYTHON) partparse.py -o @lib.texi `./whichlibs` | 
|  | 170 | $(EMACS) -batch -l fix.el -f save-buffer -kill | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 171 | mv @lib.texi lib.texi | 
| Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 172 |  | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 173 | .PRECIOUS:	lib.texi | 
|  | 174 |  | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 175 | python-lib.info: lib.texi | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 176 | -$(MAKEINFO) --footnote-style end --fill-column 72 \ | 
|  | 177 | --paragraph-indent 0 lib.texi | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 178 |  | 
|  | 179 | lib.info: python-lib.info | 
|  | 180 |  | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 181 | libwww: lib.texi | 
| Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 182 | if test ! -d $(LIBHTMLDIR); then mkdir $(LIBHTMLDIR); else true; fi | 
|  | 183 | $(PYTHON) texi2html.py -d lib.texi $(LIBHTMLDIR) | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 184 |  | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 185 | # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to | 
|  | 186 | # HTML converter.  For more info on this program, see | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 187 | # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>. | 
|  | 188 | # (I've had some trouble getting this to work with the netpbm version | 
|  | 189 | # of the pbmplus library; ppmtogif dumped core because giftopnm | 
|  | 190 | # outputs bitmap (pbm) files.  I've fixed this by changing the source | 
|  | 191 | # of LaTeX2HTML to insert a call to pnmtoppm, which I wrote myself. | 
|  | 192 | # You can probably also use "pbmtopgm | pgmtoppm"... | 
|  | 193 |  | 
|  | 194 | # In order to use these targets, you must edit the definition of L2H | 
| Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 195 | # earlier in the Makefile to point to the latex2html program.  Note | 
|  | 196 | # that LaTeX2HTML inserts references to an "icons" directory in each | 
|  | 197 | # page that it generates.  You can customize where these icons are to | 
|  | 198 | # be found; I generally make it point to "../icons" and then create a | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 199 | # symbolic link to the icons directory in the LaTeX2HTML source at the | 
|  | 200 | # appropriate place. | 
|  | 201 |  | 
| Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 202 | l2h: l2htut l2href l2hext | 
|  | 203 |  | 
|  | 204 | l2htut: tut | 
|  | 205 | $(L2H) $(L2HARGS) tut.tex | 
|  | 206 | @rm -rf python-tut | 
|  | 207 | mv tut python-tut | 
|  | 208 |  | 
|  | 209 | l2href: ref | 
|  | 210 | $(L2H) $(L2HARGS) ref.tex | 
|  | 211 | @rm -rf python-ref | 
|  | 212 | mv ref python-ref | 
|  | 213 |  | 
|  | 214 | l2hext: ext | 
|  | 215 | $(L2H) $(L2HARGS) ext.tex | 
|  | 216 | @rm -rf python-ext | 
|  | 217 | mv ext python-ext | 
| Guido van Rossum | 970871f | 1993-02-21 20:10:26 +0000 | [diff] [blame] | 218 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 219 | # This target doesn't quite work, since l2h doesn't understand the | 
|  | 220 | # funcdesc and similar environments, and turns them into GIF images. | 
|  | 221 | # Use the "libwww" target above instead. | 
|  | 222 | l2hlib: lib | 
|  | 223 | $(L2H) $(L2HARGS) lib.tex | 
|  | 224 | @rm -rf python-lib | 
|  | 225 | mv lib python-lib | 
|  | 226 |  | 
|  | 227 |  | 
|  | 228 | # Housekeeping targets | 
|  | 229 |  | 
|  | 230 | # Remove temporary files | 
| Guido van Rossum | 7f777ed | 1990-08-09 14:25:15 +0000 | [diff] [blame] | 231 | clean: | 
| Guido van Rossum | 4ac605e | 1992-12-17 15:31:02 +0000 | [diff] [blame] | 232 | rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 233 | rm -f *.bak *.orig | 
| Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 234 | # Sources: .tex, .bib, .sty | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 235 | # Useful results: .dvi, .ps, .texi, .info | 
| Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 236 |  | 
| Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 237 | # Remove temporaries as well as final products | 
| Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 238 | clobber: clean | 
| Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 239 | rm -f *.dvi *.ps *.texi *.info *.info-[0-9]* |