Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e83e380

Browse files
committed
added lots of comments
1 parent 8e6b1aa commit e83e380

1 file changed

Lines changed: 100 additions & 10 deletions

File tree

Doc/Makefile

Lines changed: 100 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,77 @@
1+
# Makefile for Python documentation
2+
# ---------------------------------
3+
#
4+
# This is a bit of a mess. The main documents are:
5+
# tut -- Tutorial (file tut.tex)
6+
# lib -- Library Reference (file lib.tex, inputs lib*.tex)
7+
# ref -- Language Reference (file ref.tex, inputs ref*.tex)
8+
# ext -- Extending and Embedding (file ext.tex)
9+
#
10+
# The main target "make all" creates DVI and PostScript for these
11+
# four. You can also do "make lib" (etc.) to process individual
12+
# documents.
13+
#
14+
# There's also:
15+
# qua -- Paper published in the CWI Quarterly (file qua.tex)
16+
#
17+
# There's one local style file: myformat.sty. This defines a number
18+
# of macros that are similar in name and intent as macros in Texinfo
19+
# (e.g. \code{...} and \emph{...}), as well as a number of
20+
# environments for formatting function and data definitions, also in
21+
# the style of Texinfo.
22+
#
23+
# Everything is processed by LaTeX. The following tools are used:
24+
# latex
25+
# makeindex
26+
# dvips
27+
# bibtex (only for formatting qua.tex)
28+
#
29+
# There's a problem with generating the index which has been solved by
30+
# a sed command applied to the index file. The shell script fix_hack
31+
# does this (the Makefile takes care of calling it).
32+
#
33+
# To preview the dvi files produced by LaTeX it would be useful to
34+
# have xdvi as well.
35+
#
36+
# Additional targets attempt to convert selected LaTeX sources to
37+
# various other formats. These are generally site specific because
38+
# the tools used are all but universal. These targets are:
39+
# l2h -- convert tut, ref, ext (but not lib!) from LaTeX to HTML
40+
# lib.texi -- convert lib from LaTeX to Texinfo
41+
# lib.info -- convert lib from Texinfo to Emacs INFO
42+
# libwww -- convert lib from Texinfo to HTML
43+
44+
# Where's dvips?
45+
DVIPS= dvips -f
46+
47+
# Install destination -- actually not used
148
DESTDIR=/usr/local
249
LIBDESTDIR=$DESTDIR/lib
350
LIBDEST=$LIBDESTDIR/python
451
DOCDESTDIR=$LIBDEST/doc
5-
DVIPS= dvips -f
652

53+
# Main target
754
all: tut.dvi lib.dvi ref.dvi ext.dvi
855

9-
ext: ext.dvi
56+
# Individual document fake targets
1057
tut: tut.dvi
11-
qua: qua.dvi
12-
ref: ref.dvi
1358
lib: lib.dvi
59+
ref: ref.dvi
60+
ext: ext.dvi
1461

62+
# CWI Quarterly document fake target
63+
qua: qua.dvi
64+
65+
# Dependencies
1566
tut.dvi lib.dvi ref.dvi ext.dvi: myformat.sty fix_hack
1667

68+
# Tutorial document
1769
tut.dvi: tut.tex
1870
latex tut
1971
latex tut
2072
$(DVIPS) tut >tut.ps
2173

74+
# Reference document
2275
ref.dvi: ref.tex ref1.tex ref2.tex ref3.tex ref4.tex ref5.tex ref6.tex \
2376
ref7.tex ref8.tex
2477
touch ref.ind
@@ -58,6 +111,7 @@ libtempfile.tex libthread.tex libtime.tex \
58111
libunix.tex liburllib.tex liburlparse.tex \
59112
libwhrandom.tex libwww.tex
60113

114+
# Library document
61115
lib.dvi: $(LIBFILES)
62116
touch lib.ind
63117
latex lib
@@ -66,6 +120,7 @@ lib.dvi: $(LIBFILES)
66120
latex lib
67121
$(DVIPS) lib >lib.ps
68122

123+
# Extensions document
69124
ext.dvi: ext.tex
70125
touch ext.ind
71126
latex ext
@@ -74,13 +129,18 @@ ext.dvi: ext.tex
74129
latex ext
75130
$(DVIPS) ext >ext.ps
76131

132+
# Quarterly document
77133
qua.dvi: qua.tex quabib.bib
78134
latex qua
79135
bibtex qua
80136
latex qua
81137
latex qua
82138
$(DVIPS) qua >qua.ps
83139

140+
141+
# The remaining part of the Makefile is concerned with various
142+
# conversions, as described above.
143+
84144
lib.texi: lib*.tex texipre.dat texipost.dat partparse.py fix.el
85145
python partparse.py -o @lib.texi `./whichlibs`
86146
emacs -batch -l fix.el -f save-buffer -kill
@@ -89,18 +149,34 @@ lib.texi: lib*.tex texipre.dat texipost.dat partparse.py fix.el
89149
.PRECIOUS: lib.texi
90150

91151
python-lib.info: lib.texi
92-
makeinfo --footnote-style end --fill-column 72 --paragraph-indent 0 \
152+
-makeinfo --footnote-style end --fill-column 72 --paragraph-indent 0 \
93153
lib.texi
94154

95155
lib.info: python-lib.info
96156

97157
# This target is very local to CWI...
98158
libwww: lib.texi
99-
texi2html -d lib.texi /ufs/guido/www/texinfo/python
100-
101-
# This one too...
102-
L2H= /usr/local/LaTeX2html/latex2html
103-
L2HARGS=-address $$USER@`domainname` -dont_include myformat -nolatex
159+
python texi2html.py -d lib.texi /ufs/guido/public_html/python-lib
160+
161+
# Targets to convert the manuals to HTML using Nikos Drakos' excellent
162+
# LaTeX to HTML Converter. For more info on this program, see
163+
# <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
164+
# (I've had some trouble getting this to work with the netpbm version
165+
# of the pbmplus library; ppmtogif dumped core because giftopnm
166+
# outputs bitmap (pbm) files. I've fixed this by changing the source
167+
# of LaTeX2HTML to insert a call to pnmtoppm, which I wrote myself.
168+
# You can probably also use "pbmtopgm | pgmtoppm"...
169+
170+
# In order to use these targets, you must edit the definition of L2H
171+
# in the Makefile to point to the latex2html program. Note that
172+
# LaTeX2HTML inserts references to an "icons" directory in each page
173+
# that it generates. You can customize where these icons are to be
174+
# found; I generally make it point to "../icons" and then create a
175+
# symbolic link to the icons directory in the LaTeX2HTML source at the
176+
# appropriate place.
177+
178+
L2H= /ufs/guido/l2h/latex2html
179+
L2HARGS=-address $$USER@`domainname` -dont_include myformat
104180
l2h: l2htut l2href l2hext
105181

106182
l2htut: tut
@@ -118,10 +194,24 @@ l2hext: ext
118194
@rm -rf python-ext
119195
mv ext python-ext
120196

197+
# This target doesn't quite work, since l2h doesn't understand the
198+
# funcdesc and similar environments, and turns them into GIF images.
199+
# Use the "libwww" target above instead.
200+
l2hlib: lib
201+
$(L2H) $(L2HARGS) lib.tex
202+
@rm -rf python-lib
203+
mv lib python-lib
204+
205+
206+
# Housekeeping targets
207+
208+
# Remove temporary files
121209
clean:
122210
rm -f @* *~ *.aux *.idx *.ilg *.ind *.log *.toc *.blg *.bbl *.pyc
211+
rm -f *.bak *.orig
123212
# Sources: .tex, .bib, .sty
124213
# Useful results: .dvi, .ps, .texi, .info
125214

215+
# Remove temporaries as well as final products
126216
clobber: clean
127217
rm -f *.dvi *.ps *.texi *.info *.info-[0-9]*

0 commit comments

Comments
 (0)