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