Added 'list_only' option (and modified 'run()' to respect it).
[python/dscho.git] / Doc / Makefile
blobd849189f32589692c8e38d7210c5d65708750ae9
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
52 PAPER=letter
54 # Ideally, you shouldn't need to edit beyond this point
56 HTMLDIR= html
57 INFODIR= info
58 TOOLSDIR= tools
60 # This is the *documentation* release, and is used to construct the file
61 # names of the downloadable tarballs.
62 RELEASE=1.5.2p1
65 # These must be declared phony since there
66 # are directories with matching names:
67 .PHONY: api doc ext lib mac ref tut
68 .PHONY: html info
71 # Main target
72 all: ps
74 dvi:
75 (cd paper-$(PAPER); $(MAKE) dvi)
77 pdf:
78 (cd paper-$(PAPER); $(MAKE) pdf)
80 ps:
81 (cd paper-$(PAPER); $(MAKE) ps)
83 world: ps pdf html tarballs
86 # Targets for each document:
87 api api.ps:
88 (cd paper-$(PAPER); $(MAKE) api.ps)
90 doc doc.ps:
91 (cd paper-$(PAPER); $(MAKE) doc.ps)
93 ext ext.ps:
94 (cd paper-$(PAPER); $(MAKE) ext.ps)
96 lib lib.ps:
97 (cd paper-$(PAPER); $(MAKE) lib.ps)
99 mac mac.ps:
100 (cd paper-$(PAPER); $(MAKE) mac.ps)
102 ref ref.ps:
103 (cd paper-$(PAPER); $(MAKE) ref.ps)
105 tut tut.ps:
106 (cd paper-$(PAPER); $(MAKE) tut.ps)
109 api.dvi:
110 (cd paper-$(PAPER); $(MAKE) api.dvi)
112 doc.dvi:
113 (cd paper-$(PAPER); $(MAKE) doc.dvi)
115 ext.dvi:
116 (cd paper-$(PAPER); $(MAKE) ext.dvi)
118 lib.dvi:
119 (cd paper-$(PAPER); $(MAKE) lib.dvi)
121 mac.dvi:
122 (cd paper-$(PAPER); $(MAKE) mac.dvi)
124 ref.dvi:
125 (cd paper-$(PAPER); $(MAKE) ref.dvi)
127 tut.dvi:
128 (cd paper-$(PAPER); $(MAKE) tut.dvi)
131 api.pdf:
132 (cd paper-$(PAPER); $(MAKE) api.pdf)
134 doc.pdf:
135 (cd paper-$(PAPER); $(MAKE) doc.pdf)
137 ext.pdf:
138 (cd paper-$(PAPER); $(MAKE) ext.pdf)
140 lib.pdf:
141 (cd paper-$(PAPER); $(MAKE) lib.pdf)
143 mac.pdf:
144 (cd paper-$(PAPER); $(MAKE) mac.pdf)
146 ref.pdf:
147 (cd paper-$(PAPER); $(MAKE) ref.pdf)
149 tut.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.
156 info:
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.
175 html:
176 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile)
178 htmlapi:
179 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile api)
181 htmldoc:
182 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile doc)
184 htmlext:
185 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ext)
187 htmllib:
188 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile lib)
190 htmlmac:
191 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile mac)
193 htmlref:
194 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ref)
196 htmltut:
197 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile tut)
200 # webchecker needs an extra flag to process the huge index from the libref
201 webcheck:
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*) \
209 | gzip -9 >$@
211 info-$(RELEASE).tar.bz2: info
212 (cd $(INFODIR); tar cf - README python.dir python-???.info*) \
213 | bzip2 -9 >$@
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) \
247 | gzip -9 >$@
249 html-$(RELEASE).tar.bz2: html
250 (cd $(HTMLDIR); tar cf - *index.html ???/*.css ???/*.html */*.gif) \
251 | bzip2 -9 >$@
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
290 clean:
291 (cd paper-$(PAPER); $(MAKE) clean)
292 (cd $(HTMLDIR); $(MAKE) clean)
293 (cd $(INFODIR); $(MAKE) clean)
295 l2hclean:
296 (cd $(HTMLDIR); $(MAKE) clean)
298 # Remove temporaries as well as final products
299 clobber:
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)
309 realclean: clobber
310 distclean: clobber