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) |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 9 | # ext -- Extending and Embedding (file ext.tex) |
| 10 | # |
Guido van Rossum | 1f17543 | 1996-10-22 20:00:02 +0000 | [diff] [blame] | 11 | # The Reference Manual is now maintained as a FrameMaker document. |
| 12 | # See the subdirectory ref; PostScript is included as ref/ref.ps. |
| 13 | # (In the future, the Tutorial will also be converted to FrameMaker; |
| 14 | # the other documents will be maintained in a text format such |
| 15 | # as LaTeX or perhaps TIM.) |
| 16 | # |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 17 | # The main target "make all" creates DVI and PostScript for these |
| 18 | # four. You can also do "make lib" (etc.) to process individual |
| 19 | # documents. |
| 20 | # |
| 21 | # There's also: |
| 22 | # qua -- Paper published in the CWI Quarterly (file qua.tex) |
| 23 | # |
| 24 | # There's one local style file: myformat.sty. This defines a number |
| 25 | # of macros that are similar in name and intent as macros in Texinfo |
| 26 | # (e.g. \code{...} and \emph{...}), as well as a number of |
| 27 | # environments for formatting function and data definitions, also in |
| 28 | # the style of Texinfo. |
| 29 | # |
| 30 | # Everything is processed by LaTeX. The following tools are used: |
| 31 | # latex |
| 32 | # makeindex |
| 33 | # dvips |
| 34 | # bibtex (only for formatting qua.tex) |
| 35 | # |
| 36 | # There's a problem with generating the index which has been solved by |
| 37 | # a sed command applied to the index file. The shell script fix_hack |
| 38 | # does this (the Makefile takes care of calling it). |
| 39 | # |
| 40 | # To preview the dvi files produced by LaTeX it would be useful to |
| 41 | # have xdvi as well. |
| 42 | # |
| 43 | # Additional targets attempt to convert selected LaTeX sources to |
| 44 | # various other formats. These are generally site specific because |
| 45 | # the tools used are all but universal. These targets are: |
Fred Drake | f1e6707 | 1996-12-06 15:11:34 +0000 | [diff] [blame] | 46 | # l2h -- convert tut, lib, ext from LaTeX to HTML |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 47 | # See the README file for more info on these targets. |
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 | # Customizations -- you *may* have to edit these |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 50 | |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 51 | # Where are the various programs? |
| 52 | LATEX= latex |
| 53 | BIBTEX= bibtex |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 54 | DVIPS= dvips -f |
| 55 | MAKEINDEX= makeindex |
Fred Drake | f93f101 | 1996-10-29 16:07:46 +0000 | [diff] [blame] | 56 | L2H= latex2html |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 57 | L2HARGS= -address $$USER@`domainname` |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 58 | |
| 59 | # Install destination -- not used now but might be useful some time... |
| 60 | DESTDIR= /usr/local |
| 61 | LIBDESTDIR= $DESTDIR/lib |
| 62 | LIBDEST= $LIBDESTDIR/python |
| 63 | DOCDESTDIR= $LIBDEST/doc |
| 64 | |
| 65 | # Ideally, you shouldn't need to edit beyond this point |
Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 66 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 67 | # Main target |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 68 | all: all-ps |
| 69 | |
Guido van Rossum | 1f17543 | 1996-10-22 20:00:02 +0000 | [diff] [blame] | 70 | all-dvi: tut.dvi lib.dvi ext.dvi |
| 71 | all-ps: tut.ps lib.ps ext.ps |
Guido van Rossum | 20aca5a | 1991-01-25 13:29:04 +0000 | [diff] [blame] | 72 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 73 | # Individual document fake targets |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 74 | tut: tut.ps |
| 75 | lib: lib.ps |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 76 | ext: ext.ps |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 77 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 78 | # CWI Quarterly document fake target |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 79 | qua: qua.ps |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 80 | |
| 81 | # Dependencies |
Guido van Rossum | 1f17543 | 1996-10-22 20:00:02 +0000 | [diff] [blame] | 82 | tut.dvi lib.dvi ext.dvi: myformat.sty fix_hack |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 83 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 84 | # Tutorial document |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 85 | tut.dvi: tut.tex |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 86 | $(LATEX) tut |
| 87 | $(LATEX) tut |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 88 | |
| 89 | tut.ps: tut.dvi |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 90 | $(DVIPS) tut >tut.ps |
Guido van Rossum | b3fa13c | 1991-01-22 11:47:14 +0000 | [diff] [blame] | 91 | |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 92 | # LaTeX source files for the Python Library Reference |
| 93 | LIBFILES = lib.tex \ |
Guido van Rossum | 40006cf | 1996-08-19 22:58:03 +0000 | [diff] [blame] | 94 | libintro.tex libobjs.tex libtypes.tex libexcs.tex libfuncs.tex \ |
| 95 | libpython.tex libsys.tex libtypes2.tex libtraceback.tex libpickle.tex \ |
| 96 | libshelve.tex libcopy.tex libmarshal.tex libimp.tex libparser.tex \ |
| 97 | libbltin.tex libmain.tex libstrings.tex libstring.tex libregex.tex \ |
| 98 | libregsub.tex libstruct.tex libmisc.tex libmath.tex librand.tex \ |
| 99 | libwhrandom.tex libarray.tex liballos.tex libos.tex libtime.tex \ |
| 100 | libgetopt.tex libtempfile.tex liberrno.tex libsomeos.tex libsignal.tex \ |
| 101 | libsocket.tex libselect.tex libthread.tex libunix.tex libposix.tex \ |
| 102 | libppath.tex libpwd.tex libgrp.tex libcrypt.tex libdbm.tex libgdbm.tex \ |
| 103 | libtermios.tex libfcntl.tex libposixfile.tex libsyslog.tex libpdb.tex \ |
| 104 | libprofile.tex libwww.tex libcgi.tex liburllib.tex libhttplib.tex \ |
| 105 | libftplib.tex libgopherlib.tex libnntplib.tex liburlparse.tex \ |
| 106 | libhtmllib.tex libsgmllib.tex librfc822.tex libmimetools.tex \ |
| 107 | libbinascii.tex libmm.tex libaudioop.tex libimageop.tex libaifc.tex \ |
| 108 | libjpeg.tex librgbimg.tex libcrypto.tex libmd5.tex libmpz.tex \ |
| 109 | librotor.tex libmac.tex libctb.tex libmacconsole.tex libmacdnr.tex \ |
| 110 | libmacfs.tex libmacos.tex libmacostools.tex libmactcp.tex \ |
| 111 | libmacspeech.tex libmacui.tex libstdwin.tex libsgi.tex libal.tex \ |
| 112 | libcd.tex libfl.tex libfm.tex libgl.tex libimgfile.tex libsun.tex \ |
Guido van Rossum | a80c398 | 1996-10-22 01:12:13 +0000 | [diff] [blame] | 113 | libxdrlib.tex libimghdr.tex \ |
| 114 | librestricted.tex librexec.tex libbastion.tex \ |
Guido van Rossum | 3dd68d3 | 1996-12-31 02:24:54 +0000 | [diff] [blame^] | 115 | libformatter.tex liboperator.tex libsoundex.tex libresource.tex \ |
| 116 | libstat.tex |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 117 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 118 | # Library document |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 119 | lib.dvi: $(LIBFILES) |
Guido van Rossum | b83241c | 1992-03-06 10:56:42 +0000 | [diff] [blame] | 120 | touch lib.ind |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 121 | $(LATEX) lib |
Guido van Rossum | 95cd2ef | 1992-12-08 14:37:55 +0000 | [diff] [blame] | 122 | ./fix_hack lib.idx |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 123 | $(MAKEINDEX) lib.idx |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 124 | $(LATEX) lib |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 125 | |
| 126 | lib.ps: lib.dvi |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 127 | $(DVIPS) lib >lib.ps |
Guido van Rossum | a52117e | 1991-11-21 13:54:36 +0000 | [diff] [blame] | 128 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 129 | # Extensions document |
Guido van Rossum | f8daa4f | 1996-08-23 15:33:51 +0000 | [diff] [blame] | 130 | ext.dvi: ext.tex extref.tex |
Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 131 | touch ext.ind |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 132 | $(LATEX) ext |
Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 133 | ./fix_hack ext.idx |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 134 | $(MAKEINDEX) ext.idx |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 135 | $(LATEX) ext |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 136 | |
| 137 | ext.ps: ext.dvi |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 138 | $(DVIPS) ext >ext.ps |
Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 139 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 140 | # Quarterly document |
Guido van Rossum | 16d6e71 | 1994-08-08 12:30:22 +0000 | [diff] [blame] | 141 | qua.dvi: qua.tex quabib.bib |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 142 | $(LATEX) qua |
| 143 | $(BIBTEX) qua |
| 144 | $(LATEX) qua |
| 145 | $(BIBTEX) qua |
Guido van Rossum | eb8d503 | 1996-08-09 21:46:05 +0000 | [diff] [blame] | 146 | |
| 147 | qua.ps: qua.dvi |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 148 | $(DVIPS) qua >qua.ps |
Guido van Rossum | b3fa13c | 1991-01-22 11:47:14 +0000 | [diff] [blame] | 149 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 150 | |
| 151 | # The remaining part of the Makefile is concerned with various |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 152 | # conversions, as described above. See also the README file. |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 153 | |
Guido van Rossum | 73827c6 | 1995-03-20 13:00:32 +0000 | [diff] [blame] | 154 | # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to |
| 155 | # HTML converter. For more info on this program, see |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 156 | # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>. |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 157 | |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 158 | # Note that LaTeX2HTML inserts references to an "icons" directory in |
| 159 | # each page that it generates. You can customize where these icons |
| 160 | # are to be found; I generally make it point to "../icons" and then |
| 161 | # create a symbolic link to the icons directory in the LaTeX2HTML |
| 162 | # source at the appropriate place. Change the definition of |
| 163 | # $ICONSERVER in .latex2html-init to point to a different location. |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 164 | |
Fred Drake | fc8f6f3 | 1996-12-06 18:45:30 +0000 | [diff] [blame] | 165 | # The sed hack rips out a superfluous comma which I haven't found the source |
| 166 | # of; the prominent location makes it worth the extra step. This affects the |
| 167 | # title pages! |
| 168 | |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 169 | l2h: l2htut l2hext l2hlib |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 170 | |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 171 | l2htut: tut.dvi myformat.perl |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 172 | $(L2H) $(L2HARGS) tut.tex |
| 173 | @rm -rf python-tut |
Fred Drake | fc8f6f3 | 1996-12-06 18:45:30 +0000 | [diff] [blame] | 174 | sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \ |
| 175 | <tut/tut.html >tut/xxx |
| 176 | mv tut/xxx tut/tut.html |
Fred Drake | d560605 | 1996-12-06 20:06:37 +0000 | [diff] [blame] | 177 | ln -s tut.html tut/index.html |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 178 | mv tut python-tut |
| 179 | |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 180 | l2hext: ext.dvi myformat.perl |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 181 | $(L2H) $(L2HARGS) ext.tex |
| 182 | @rm -rf python-ext |
Fred Drake | fc8f6f3 | 1996-12-06 18:45:30 +0000 | [diff] [blame] | 183 | sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \ |
| 184 | <ext/ext.html >ext/xxx |
Fred Drake | d560605 | 1996-12-06 20:06:37 +0000 | [diff] [blame] | 185 | ln -s ext.html ext/index.html |
Fred Drake | fc8f6f3 | 1996-12-06 18:45:30 +0000 | [diff] [blame] | 186 | mv ext/xxx ext/ext.html |
Guido van Rossum | 6938f06 | 1994-08-01 12:22:53 +0000 | [diff] [blame] | 187 | mv ext python-ext |
Guido van Rossum | 970871f | 1993-02-21 20:10:26 +0000 | [diff] [blame] | 188 | |
Fred Drake | b4d4e25 | 1996-11-11 21:03:01 +0000 | [diff] [blame] | 189 | l2hlib: lib.dvi myformat.perl |
| 190 | ./fix_libaux.sed <lib.aux >@lib.aux |
| 191 | mv @lib.aux lib.aux |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 192 | $(L2H) $(L2HARGS) lib.tex |
Fred Drake | f1e6707 | 1996-12-06 15:11:34 +0000 | [diff] [blame] | 193 | sed 's/^<P CLASS=ABSTRACT>,/<P CLASS=ABSTRACT>/' \ |
| 194 | <lib/lib.html >lib/xxx |
| 195 | mv lib/xxx lib/lib.html |
Fred Drake | d560605 | 1996-12-06 20:06:37 +0000 | [diff] [blame] | 196 | ln -s lib.html lib/index.html |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 197 | @rm -rf python-lib |
| 198 | mv lib python-lib |
| 199 | |
| 200 | |
| 201 | # Housekeeping targets |
| 202 | |
| 203 | # Remove temporary files |
Guido van Rossum | 7f777ed | 1990-08-09 14:25:15 +0000 | [diff] [blame] | 204 | clean: |
Guido van Rossum | 4ac605e | 1992-12-17 15:31:02 +0000 | [diff] [blame] | 205 | rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 206 | rm -f *.bak *.orig |
Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 207 | # Sources: .tex, .bib, .sty |
Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 208 | # Useful results: .dvi, .ps, .texi, .info |
Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 209 | |
Guido van Rossum | e83e380 | 1995-03-17 16:01:35 +0000 | [diff] [blame] | 210 | # Remove temporaries as well as final products |
Guido van Rossum | 5b34373 | 1992-07-07 09:06:34 +0000 | [diff] [blame] | 211 | clobber: clean |
Guido van Rossum | 7a2dba2 | 1993-11-05 14:45:11 +0000 | [diff] [blame] | 212 | rm -f *.dvi *.ps *.texi *.info *.info-[0-9]* |