1 # Makefile for Python documentation
2 # ---------------------------------
4 # See also the README file.
6 # This is a bit of a mess. The documents are identified by short names:
7 # api -- Python/C API Reference Manual
8 # doc -- Documenting Python
9 # ext -- Extending and Embedding the Python Interpreter
10 # lib -- Library Reference Manual
11 # mac -- Macintosh Library Modules
12 # ref -- Python Reference Manual
13 # tut -- Python Tutorial
14 # inst -- Installing Python Modules
15 # dist -- Distributing Python Modules
17 # The latex sources for each of these documents are in subdirectories
18 # with the three-letter designations above as the directory names.
20 # The main target creates DVI and PostScript for the main each of the
21 # documents. You can also do "make lib" (etc.) to create the DVI and
22 # PostScript versions of individual documents.
24 # The document classes and styles are in the texinputs/ directory.
25 # These define a number of macros that are similar in name and intent
26 # as macros in Texinfo (e.g. \code{...} and \emph{...}), as well as a
27 # number of environments for formatting function and data definitions.
29 # Everything is processed by LaTeX. See the file `README' for more
30 # information on the tools needed for processing.
32 # There's a problem with generating the index which has been solved by
33 # a sed command applied to the index file. The shell script fix_hack
34 # does this (the Makefile takes care of calling it).
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:
40 # html -- convert all documents from LaTeX to HTML
41 # pdf -- convert all documents from LaTeX to the
42 # Portable Document Format
44 # See the README file for more information on these targets.
46 # The formatted output is located in subdirectories. For PDF and
47 # PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in
48 # the html/ directory. If you want to fix the GNU info process, look
49 # in the info/ directory; please send patches to python-docs@python.org.
51 # Customizations -- you *may* have to edit these
53 # you could set this to a4
56 # Ideally, you shouldn't need to edit beyond this point
62 # This is the *documentation* release, and is used to construct the file
63 # names of the downloadable tarballs.
67 # These must be declared phony since there
68 # are directories with matching names:
69 .PHONY
: api doc ext lib mac ref tut inst
dist
70 .PHONY
: html
info longhtml
77 (cd paper-
$(PAPER
); $(MAKE
) dvi)
80 (cd paper-
$(PAPER
); $(MAKE
) pdf
)
83 (cd paper-
$(PAPER
); $(MAKE
) ps
)
85 world
: ps pdf html tarballs
88 # Targets for each document:
90 (cd paper-
$(PAPER
); $(MAKE
) api.ps
)
93 (cd paper-
$(PAPER
); $(MAKE
) doc.ps
)
96 (cd paper-
$(PAPER
); $(MAKE
) ext.ps
)
99 (cd paper-
$(PAPER
); $(MAKE
) lib.ps
)
102 (cd paper-
$(PAPER
); $(MAKE
) mac.ps
)
105 (cd paper-
$(PAPER
); $(MAKE
) ref.ps
)
108 (cd paper-
$(PAPER
); $(MAKE
) tut.ps
)
111 (cd paper-
$(PAPER
); $(MAKE
) inst.ps
)
114 (cd paper-
$(PAPER
); $(MAKE
) dist.ps
)
118 (cd paper-
$(PAPER
); $(MAKE
) api.
dvi)
121 (cd paper-
$(PAPER
); $(MAKE
) doc.
dvi)
124 (cd paper-
$(PAPER
); $(MAKE
) ext.
dvi)
127 (cd paper-
$(PAPER
); $(MAKE
) lib.
dvi)
130 (cd paper-
$(PAPER
); $(MAKE
) mac.
dvi)
133 (cd paper-
$(PAPER
); $(MAKE
) ref.
dvi)
136 (cd paper-
$(PAPER
); $(MAKE
) tut.
dvi)
139 (cd paper-
$(PAPER
); $(MAKE
) inst.
dvi)
142 (cd paper-
$(PAPER
); $(MAKE
) dist.
dvi)
146 (cd paper-
$(PAPER
); $(MAKE
) api.pdf
)
149 (cd paper-
$(PAPER
); $(MAKE
) doc.pdf
)
152 (cd paper-
$(PAPER
); $(MAKE
) ext.pdf
)
155 (cd paper-
$(PAPER
); $(MAKE
) lib.pdf
)
158 (cd paper-
$(PAPER
); $(MAKE
) mac.pdf
)
161 (cd paper-
$(PAPER
); $(MAKE
) ref.pdf
)
164 (cd paper-
$(PAPER
); $(MAKE
) tut.pdf
)
167 (cd paper-
$(PAPER
); $(MAKE
) inst.pdf
)
170 (cd paper-
$(PAPER
); $(MAKE
) dist.pdf
)
173 # The remaining part of the Makefile is concerned with various
174 # conversions, as described above. See also the README file.
177 (cd
$(INFODIR
); $(MAKE
))
179 # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
180 # HTML converter. For more info on this program, see
181 # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
183 # Note that LaTeX2HTML inserts references to an icons directory in
184 # each page that it generates. I have placed a copy of this directory
185 # in the distribution to simplify the process of creating a
186 # self-contained HTML distribution; for this purpose I have also added
187 # a (trivial) index.html. Change the definition of $ICONSERVER in
188 # perl/l2hinit.perl to use a different location for the icons directory.
190 # If you have the standard LaTeX2HTML icons installed, the versions shipped
191 # with this documentation should be stored in a separate directory and used
192 # instead. The standard set does *not* include all the icons used in the
193 # Python documentation.
196 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile
)
199 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile api
)
202 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile doc
)
205 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ext
)
208 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile lib
)
211 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile mac
)
214 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ref
)
217 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile tut
)
220 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile inst
)
223 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile
dist)
226 (cd longhtml
; $(MAKE
) PAPER
=$(PAPER
))
229 # webchecker needs an extra flag to process the huge index from the libref
231 (cd
$(HTMLDIR
); $(MAKE
) -f ..
/html
/Makefile webcheck
)
234 # Release packaging targets:
236 info-
$(RELEASE
).tgz
: info
237 (cd
$(INFODIR
); tar cf
- README python.
dir python-???.
info*) \
240 info-
$(RELEASE
).
tar.bz2
: info
241 (cd
$(INFODIR
); tar cf
- README python.
dir python-???.
info*) \
244 latex-
$(RELEASE
).tgz
:
245 $(TOOLSDIR
)/mksourcepkg
--gzip
$(RELEASE
)
247 latex-
$(RELEASE
).
tar.bz2
:
248 $(TOOLSDIR
)/mksourcepkg
--bzip2
$(RELEASE
)
250 latex-
$(RELEASE
).zip
:
252 $(TOOLSDIR
)/mksourcepkg
--zip
$(RELEASE
)
254 pdf-
$(PAPER
)-$(RELEASE
).tgz
: pdf
255 (cd paper-
$(PAPER
); tar cf
- *.pdf
) | gzip
-9 >$@
257 pdf-
$(PAPER
)-$(RELEASE
).
tar.bz2
: pdf
258 (cd paper-
$(PAPER
); tar cf
- *.pdf
) | bzip2
-9 >$@
260 pdf-
$(PAPER
)-$(RELEASE
).zip
: pdf
262 (cd paper-
$(PAPER
); zip
-q
-9 ..
/$@
*.pdf
)
264 postscript-
$(PAPER
)-$(RELEASE
).
tar.bz2
: ps
265 (cd paper-
$(PAPER
); $(MAKE
) README
)
266 (cd paper-
$(PAPER
); tar cf
- *.ps README
) | bzip2
-9 >$@
268 postscript-
$(PAPER
)-$(RELEASE
).tgz
: ps
269 (cd paper-
$(PAPER
); $(MAKE
) README
)
270 (cd paper-
$(PAPER
); tar cf
- *.ps README
) | gzip
-9 >$@
272 postscript-
$(PAPER
)-$(RELEASE
).zip
: ps
273 (cd paper-
$(PAPER
); $(MAKE
) README
)
275 (cd paper-
$(PAPER
); zip
-q
-9 ..
/$@
*.ps README
)
277 html-
$(RELEASE
).tgz
: html
279 tar cf
- *index.html
*/*.css
*/*.html
*/*.gif
) \
282 html-
$(RELEASE
).
tar.bz2
: html
284 tar cf
- *index.html
*/*.css
*/*.html
*/*.gif
) \
287 html-
$(RELEASE
).zip
: html
290 zip
-q
-9 ..
/$@
*index.html
*/*.css
*/*.html
*/*.gif
)
292 longhtml-
$(RELEASE
).zip
: longhtml
295 zip
-q
-9 ..
/$@
*/*.css
*/*.html
*/*.gif
)
297 # convenience targets:
299 tarhtml
: html-
$(RELEASE
).tgz
300 tarinfo
: info-
$(RELEASE
).tgz
301 tarps
: postscript-
$(PAPER
)-$(RELEASE
).tgz
302 tarpdf
: pdf-
$(PAPER
)-$(RELEASE
).tgz
303 tarlatex
: latex-
$(RELEASE
).tgz
305 tarballs
: tarpdf tarps tarhtml
307 ziphtml
: html-
$(RELEASE
).zip
308 ziplonghtml
: longhtml-
$(RELEASE
).zip
309 zipps
: postscript-
$(PAPER
)-$(RELEASE
).zip
310 zippdf
: pdf-
$(PAPER
)-$(RELEASE
).zip
311 ziplatex
: latex-
$(RELEASE
).zip
313 # Only build the longhtml version for final releases; use the second
314 # version of this for pre-release versions.
316 #zips: zippdf zipps ziphtml ziplonghtml
317 zips
: zippdf zipps ziphtml
319 bziphtml
: html-
$(RELEASE
).
tar.bz2
320 bzipinfo
: info-
$(RELEASE
).
tar.bz2
321 bzipps
: postscript-
$(PAPER
)-$(RELEASE
).
tar.bz2
322 bzippdf
: pdf-
$(PAPER
)-$(RELEASE
).
tar.bz2
323 bziplatex
: latex-
$(RELEASE
).
tar.bz2
325 bzips
: bzippdf bzipps bziphtml
327 distfiles
: tarballs zips bzips
328 $(TOOLSDIR
)/mksourcepkg
--all $(RELEASE
)
331 # Housekeeping targets
333 # Remove temporary files; all except the following:
334 # - sources: .tex, .bib, .sty, *.cls
335 # - useful results: .dvi, .pdf, .ps, .texi, .info
337 (cd paper-
$(PAPER
); $(MAKE
) clean)
338 (cd longhtml
; $(MAKE
) clean)
339 (cd
$(HTMLDIR
); $(MAKE
) clean)
340 (cd
$(INFODIR
); $(MAKE
) clean)
343 (cd
$(HTMLDIR
); $(MAKE
) clean)
345 # Remove temporaries as well as final products
347 (cd
$(HTMLDIR
); $(MAKE
) clobber)
348 rm -f html-
$(RELEASE
).tgz info-
$(RELEASE
).tgz
349 rm -f pdf-
$(RELEASE
).tgz postscript-
$(RELEASE
).tgz
350 rm -f latex-
$(RELEASE
).tgz html-
$(RELEASE
).zip
351 rm -f pdf-
$(RELEASE
).zip postscript-
$(RELEASE
).zip
352 (cd paper-
$(PAPER
); $(MAKE
) clobber)
353 (cd longhtml
; $(MAKE
) clobber)
354 (cd
$(HTMLDIR
); $(MAKE
) clobber)
355 (cd
$(INFODIR
); $(MAKE
) clobber)