Last set of CW Pro 5 projects (probably)
[python/dscho.git] / Doc / Makefile
blobc2ceb7c0f0d608e34403cf2eb3c5d8dac00fd8b5
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
54 PAPER=letter
56 # Ideally, you shouldn't need to edit beyond this point
58 HTMLDIR= html
59 INFODIR= info
60 TOOLSDIR= tools
62 # This is the *documentation* release, and is used to construct the file
63 # names of the downloadable tarballs.
64 RELEASE=2.0b1
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
73 # Main target
74 all: ps
76 dvi:
77 (cd paper-$(PAPER); $(MAKE) dvi)
79 pdf:
80 (cd paper-$(PAPER); $(MAKE) pdf)
82 ps:
83 (cd paper-$(PAPER); $(MAKE) ps)
85 world: ps pdf html tarballs
88 # Targets for each document:
89 api api.ps:
90 (cd paper-$(PAPER); $(MAKE) api.ps)
92 doc doc.ps:
93 (cd paper-$(PAPER); $(MAKE) doc.ps)
95 ext ext.ps:
96 (cd paper-$(PAPER); $(MAKE) ext.ps)
98 lib lib.ps:
99 (cd paper-$(PAPER); $(MAKE) lib.ps)
101 mac mac.ps:
102 (cd paper-$(PAPER); $(MAKE) mac.ps)
104 ref ref.ps:
105 (cd paper-$(PAPER); $(MAKE) ref.ps)
107 tut tut.ps:
108 (cd paper-$(PAPER); $(MAKE) tut.ps)
110 inst inst.ps:
111 (cd paper-$(PAPER); $(MAKE) inst.ps)
113 dist dist.ps:
114 (cd paper-$(PAPER); $(MAKE) dist.ps)
117 api.dvi:
118 (cd paper-$(PAPER); $(MAKE) api.dvi)
120 doc.dvi:
121 (cd paper-$(PAPER); $(MAKE) doc.dvi)
123 ext.dvi:
124 (cd paper-$(PAPER); $(MAKE) ext.dvi)
126 lib.dvi:
127 (cd paper-$(PAPER); $(MAKE) lib.dvi)
129 mac.dvi:
130 (cd paper-$(PAPER); $(MAKE) mac.dvi)
132 ref.dvi:
133 (cd paper-$(PAPER); $(MAKE) ref.dvi)
135 tut.dvi:
136 (cd paper-$(PAPER); $(MAKE) tut.dvi)
138 inst.dvi:
139 (cd paper-$(PAPER); $(MAKE) inst.dvi)
141 dist.dvi:
142 (cd paper-$(PAPER); $(MAKE) dist.dvi)
145 api.pdf:
146 (cd paper-$(PAPER); $(MAKE) api.pdf)
148 doc.pdf:
149 (cd paper-$(PAPER); $(MAKE) doc.pdf)
151 ext.pdf:
152 (cd paper-$(PAPER); $(MAKE) ext.pdf)
154 lib.pdf:
155 (cd paper-$(PAPER); $(MAKE) lib.pdf)
157 mac.pdf:
158 (cd paper-$(PAPER); $(MAKE) mac.pdf)
160 ref.pdf:
161 (cd paper-$(PAPER); $(MAKE) ref.pdf)
163 tut.pdf:
164 (cd paper-$(PAPER); $(MAKE) tut.pdf)
166 inst.pdf:
167 (cd paper-$(PAPER); $(MAKE) inst.pdf)
169 dist.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.
176 info:
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.
195 html:
196 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile)
198 htmlapi:
199 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile api)
201 htmldoc:
202 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile doc)
204 htmlext:
205 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ext)
207 htmllib:
208 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile lib)
210 htmlmac:
211 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile mac)
213 htmlref:
214 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile ref)
216 htmltut:
217 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile tut)
219 htmlinst:
220 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile inst)
222 htmldist:
223 (cd $(HTMLDIR); $(MAKE) PAPER=$(PAPER) -f ../html/Makefile dist)
225 longhtml:
226 (cd longhtml; $(MAKE) PAPER=$(PAPER))
229 # webchecker needs an extra flag to process the huge index from the libref
230 webcheck:
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*) \
238 | gzip -9 >$@
240 info-$(RELEASE).tar.bz2: info
241 (cd $(INFODIR); tar cf - README python.dir python-???.info*) \
242 | bzip2 -9 >$@
244 latex-$(RELEASE).tgz:
245 $(TOOLSDIR)/mksourcepkg --gzip $(RELEASE)
247 latex-$(RELEASE).tar.bz2:
248 $(TOOLSDIR)/mksourcepkg --bzip2 $(RELEASE)
250 latex-$(RELEASE).zip:
251 rm -f $@
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
261 rm -f $@
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)
274 rm -f $@
275 (cd paper-$(PAPER); zip -q -9 ../$@ *.ps README)
277 html-$(RELEASE).tgz: html
278 (cd $(HTMLDIR); \
279 tar cf - *index.html */*.css */*.html */*.gif) \
280 | gzip -9 >$@
282 html-$(RELEASE).tar.bz2: html
283 (cd $(HTMLDIR); \
284 tar cf - *index.html */*.css */*.html */*.gif) \
285 | bzip2 -9 >$@
287 html-$(RELEASE).zip: html
288 rm -f $@
289 (cd $(HTMLDIR); \
290 zip -q -9 ../$@ *index.html */*.css */*.html */*.gif)
292 longhtml-$(RELEASE).zip: longhtml
293 rm -f $@
294 (cd 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
336 clean:
337 (cd paper-$(PAPER); $(MAKE) clean)
338 (cd longhtml; $(MAKE) clean)
339 (cd $(HTMLDIR); $(MAKE) clean)
340 (cd $(INFODIR); $(MAKE) clean)
342 l2hclean:
343 (cd $(HTMLDIR); $(MAKE) clean)
345 # Remove temporaries as well as final products
346 clobber:
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)
357 realclean: clobber
358 distclean: clobber