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
15 # The latex sources for each of these documents are in subdirectories
16 # with the three-letter designations above as the directory names.
18 # The main target creates DVI and PostScript for the main each of the
19 # documents. You can also do "make lib" (etc.) to create the DVI and
20 # PostScript versions of individual documents.
22 # The document classes and styles are in the texinputs/ directory.
23 # These define a number of macros that are similar in name and intent
24 # as macros in Texinfo (e.g. \code{...} and \emph{...}), as well as a
25 # number of environments for formatting function and data definitions.
27 # Everything is processed by LaTeX. See the file `README' for more
28 # information on the tools needed for processing.
30 # There's a problem with generating the index which has been solved by
31 # a sed command applied to the index file. The shell script fix_hack
32 # does this (the Makefile takes care of calling it).
34 # Additional targets attempt to convert selected LaTeX sources to
35 # various other formats. These are generally site specific because
36 # the tools used are all but universal. These targets are:
38 # html -- convert all documents from LaTeX to HTML
39 # pdf -- convert all documents from LaTeX to the
40 # Portable Document Format
42 # See the README file for more information on these targets.
44 # The formatted output is located in subdirectories. For PDF and
45 # PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in
46 # the html/ directory. If you want to fix the GNU info process, look
47 # in the info/ directory; please send patches to python-docs@python.org.
49 # Customizations -- you *may* have to edit these
51 # you could set this to a4
54 # Ideally, you shouldn't need to edit beyond this point
60 # This is the *documentation* release, and is used to construct the file
61 # names of the downloadable tarballs.
65 # These must be declared phony since there
66 # are directories with matching names:
67 .PHONY
: api doc ext lib mac ref tut
75 (cd paper-
$(PAPER
); $(MAKE
) dvi)
78 (cd paper-
$(PAPER
); $(MAKE
) pdf
)
81 (cd paper-
$(PAPER
); $(MAKE
) ps
)
83 world
: ps pdf html tarballs
86 # Targets for each document:
88 (cd paper-
$(PAPER
); $(MAKE
) api.ps
)
91 (cd paper-
$(PAPER
); $(MAKE
) doc.ps
)
94 (cd paper-
$(PAPER
); $(MAKE
) ext.ps
)
97 (cd paper-
$(PAPER
); $(MAKE
) lib.ps
)
100 (cd paper-
$(PAPER
); $(MAKE
) mac.ps
)
103 (cd paper-
$(PAPER
); $(MAKE
) ref.ps
)
106 (cd paper-
$(PAPER
); $(MAKE
) tut.ps
)
110 (cd paper-
$(PAPER
); $(MAKE
) api.
dvi)
113 (cd paper-
$(PAPER
); $(MAKE
) doc.
dvi)
116 (cd paper-
$(PAPER
); $(MAKE
) ext.
dvi)
119 (cd paper-
$(PAPER
); $(MAKE
) lib.
dvi)
122 (cd paper-
$(PAPER
); $(MAKE
) mac.
dvi)
125 (cd paper-
$(PAPER
); $(MAKE
) ref.
dvi)
128 (cd paper-
$(PAPER
); $(MAKE
) tut.
dvi)
132 (cd paper-
$(PAPER
); $(MAKE
) api.pdf
)
135 (cd paper-
$(PAPER
); $(MAKE
) doc.pdf
)
138 (cd paper-
$(PAPER
); $(MAKE
) ext.pdf
)
141 (cd paper-
$(PAPER
); $(MAKE
) lib.pdf
)
144 (cd paper-
$(PAPER
); $(MAKE
) mac.pdf
)
147 (cd paper-
$(PAPER
); $(MAKE
) ref.pdf
)
150 (cd paper-
$(PAPER
); $(MAKE
) tut.pdf
)
153 # The remaining part of the Makefile is concerned with various
154 # conversions, as described above. See also the README file.
157 (cd
$(INFODIR
); $(MAKE
))
159 # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
160 # HTML converter. For more info on this program, see
161 # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
163 # Note that LaTeX2HTML inserts references to an icons directory in
164 # each page that it generates. I have placed a copy of this directory
165 # in the distribution to simplify the process of creating a
166 # self-contained HTML distribution; for this purpose I have also added
167 # a (trivial) index.html. Change the definition of $ICONSERVER in
168 # perl/l2hinit.perl to use a different location for the icons directory.
170 # If you have the standard LaTeX2HTML icons installed, the versions shipped
171 # with this documentation should be stored in a separate directory and used
172 # instead. The standard set does *not* include all the icons used in the
173 # Python documentation.
176 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile
)
179 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile api
)
182 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile doc
)
185 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ext
)
188 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile lib
)
191 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile mac
)
194 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ref
)
197 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile tut
)
200 # webchecker needs an extra flag to process the huge index from the libref
202 (cd
$(HTMLDIR
); $(MAKE
) -f ..
/html
/Makefile webcheck
)
205 # Release packaging targets:
207 info-
$(RELEASE
).tgz
: info
208 (cd
$(INFODIR
); tar cf
- README python.
dir python-???.
info*) \
211 info-
$(RELEASE
).
tar.bz2
: info
212 (cd
$(INFODIR
); tar cf
- README python.
dir python-???.
info*) \
215 latex-
$(RELEASE
).tgz
:
216 $(TOOLSDIR
)/mksourcepkg
--gzip
$(RELEASE
)
218 latex-
$(RELEASE
).
tar.bz2
:
219 $(TOOLSDIR
)/mksourcepkg
--bzip2
$(RELEASE
)
221 latex-
$(RELEASE
).zip
:
222 $(TOOLSDIR
)/mksourcepkg
--zip
$(RELEASE
)
224 pdf-
$(PAPER
)-$(RELEASE
).tgz
: pdf
225 (cd paper-
$(PAPER
); tar cf
- *.pdf
) | gzip
-9 >$@
227 pdf-
$(PAPER
)-$(RELEASE
).
tar.bz2
: pdf
228 (cd paper-
$(PAPER
); tar cf
- *.pdf
) | bzip2
-9 >$@
230 pdf-
$(PAPER
)-$(RELEASE
).zip
: pdf
231 (cd paper-
$(PAPER
); zip
-9 ..
/$@
*.pdf
)
233 postscript-
$(PAPER
)-$(RELEASE
).
tar.bz2
: ps
234 (cd paper-
$(PAPER
); $(MAKE
) README
)
235 (cd paper-
$(PAPER
); tar cf
- *.ps README
) | gzip
-9 >$@
237 postscript-
$(PAPER
)-$(RELEASE
).tgz
: ps
238 (cd paper-
$(PAPER
); $(MAKE
) README
)
239 (cd paper-
$(PAPER
); tar cf
- *.ps README
) | bzip2
-9 >$@
241 postscript-
$(PAPER
)-$(RELEASE
).zip
: ps
242 (cd paper-
$(PAPER
); $(MAKE
) README
)
243 (cd paper-
$(PAPER
); zip
-9 ..
/$@
*.ps README
)
245 html-
$(RELEASE
).tgz
: html
246 (cd
$(HTMLDIR
); tar cf
- *index.html ???
/*.css ???
/*.html
*/*.gif
) \
249 html-
$(RELEASE
).
tar.bz2
: html
250 (cd
$(HTMLDIR
); tar cf
- *index.html ???
/*.css ???
/*.html
*/*.gif
) \
253 html-
$(RELEASE
).zip
: html
254 (cd
$(HTMLDIR
); zip
-9 ..
/$@
*index.html ???
/*.css ???
/*.html
*/*.gif
)
256 # convenience targets:
258 tarhtml
: html-
$(RELEASE
).tgz
259 tarinfo
: info-
$(RELEASE
).tgz
260 tarps
: postscript-
$(PAPER
)-$(RELEASE
).tgz
261 tarpdf
: pdf-
$(PAPER
)-$(RELEASE
).tgz
262 tarlatex
: latex-
$(RELEASE
).tgz
264 tarballs
: tarpdf tarps tarhtml
266 ziphtml
: html-
$(RELEASE
).zip
267 zipps
: postscript-
$(PAPER
)-$(RELEASE
).zip
268 zippdf
: pdf-
$(PAPER
)-$(RELEASE
).zip
269 ziplatex
: latex-
$(RELEASE
).zip
271 zips
: zippdf zipps ziphtml
273 bziphtml
: html-
$(RELEASE
).
tar.bz2
274 bzipinfo
: info-
$(RELEASE
).
tar.bz2
275 bzipps
: postscript-
$(PAPER
)-$(RELEASE
).
tar.bz2
276 bzippdf
: pdf-
$(PAPER
)-$(RELEASE
).
tar.bz2
277 bziplatex
: latex-
$(RELEASE
).
tar.bz2
279 bzips
: bzippdf bzipps bziphtml
281 distfiles
: tarballs zips bzips
282 $(TOOLSDIR
)/mksourcepkg
--all $(RELEASE
)
285 # Housekeeping targets
287 # Remove temporary files; all except the following:
288 # - sources: .tex, .bib, .sty, *.cls
289 # - useful results: .dvi, .pdf, .ps, .texi, .info
291 (cd paper-
$(PAPER
); $(MAKE
) clean)
292 (cd
$(HTMLDIR
); $(MAKE
) clean)
293 (cd
$(INFODIR
); $(MAKE
) clean)
296 (cd
$(HTMLDIR
); $(MAKE
) clean)
298 # Remove temporaries as well as final products
300 (cd
$(HTMLDIR
); $(MAKE
) clobber)
301 rm -f html-
$(RELEASE
).tgz info-
$(RELEASE
).tgz
302 rm -f pdf-
$(RELEASE
).tgz postscript-
$(RELEASE
).tgz
303 rm -f latex-
$(RELEASE
).tgz html-
$(RELEASE
).zip
304 rm -f pdf-
$(RELEASE
).zip postscript-
$(RELEASE
).zip
305 (cd paper-
$(PAPER
); $(MAKE
) clobber)
306 (cd
$(HTMLDIR
); $(MAKE
) clobber)
307 (cd
$(INFODIR
); $(MAKE
) clobber)