1 # Makefile for Python documentation
2 # ---------------------------------
4 # See also the README file.
6 # This is a bit of a mess. The main documents are:
7 # api -- Python/C API Reference Manual
8 # ext -- Extending and Embedding the Python Interpreter
9 # lib -- Library Reference Manual
10 # mac -- Macintosh Library Modules
11 # ref -- Python Reference Manual
12 # tut -- Python Tutorial
14 # The latex sources for each of these documents are in subdirectories
15 # with the three-letter designations above as the directory names.
17 # The main target creates DVI and PostScript for the main each of the
18 # documents. You can also do "make lib" (etc.) to create the DVI and
19 # PostScript versions of individual documents.
21 # The document classes and styles are in the texinputs/ directory.
22 # These define a number of macros that are similar in name and intent
23 # as macros in Texinfo (e.g. \code{...} and \emph{...}), as well as a
24 # number of environments for formatting function and data definitions.
26 # Everything is processed by LaTeX. See the file `README' for more
27 # information on the tools needed for processing.
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).
33 # Additional targets attempt to convert selected LaTeX sources to
34 # various other formats. These are generally site specific because
35 # the tools used are all but universal. These targets are:
37 # html -- convert all documents from LaTeX to HTML
38 # pdf -- convert all documents from LaTeX to the
39 # Portable Document Format
41 # See the README file for more information on these targets.
43 # The formatted output is located in subdirectories. For PDF and
44 # PostScript, look in the paper-$(PAPER)/ directory. For HTML, look in
45 # the html/ directory. If you want to fix the GNU info process, look
46 # in the info/ directory; please send patches to python-docs@python.org.
48 # Customizations -- you *may* have to edit these
50 # you could set this to a4
53 # Ideally, you shouldn't need to edit beyond this point
62 # These must be declared phony since there
63 # are directories with matching names:
64 .PHONY
: api ext lib mac ref tut
72 (cd paper-
$(PAPER
); $(MAKE
) dvi)
75 (cd paper-
$(PAPER
); $(MAKE
) pdf
)
78 (cd paper-
$(PAPER
); $(MAKE
) ps
)
80 world
: ps pdf html tarballs
83 # Targets for each document:
85 (cd paper-
$(PAPER
); $(MAKE
) api.ps
)
88 (cd paper-
$(PAPER
); $(MAKE
) ext.ps
)
91 (cd paper-
$(PAPER
); $(MAKE
) lib.ps
)
94 (cd paper-
$(PAPER
); $(MAKE
) mac.ps
)
97 (cd paper-
$(PAPER
); $(MAKE
) ref.ps
)
100 (cd paper-
$(PAPER
); $(MAKE
) tut.ps
)
104 (cd paper-
$(PAPER
); $(MAKE
) api.
dvi)
107 (cd paper-
$(PAPER
); $(MAKE
) ext.
dvi)
110 (cd paper-
$(PAPER
); $(MAKE
) lib.
dvi)
113 (cd paper-
$(PAPER
); $(MAKE
) mac.
dvi)
116 (cd paper-
$(PAPER
); $(MAKE
) ref.
dvi)
119 (cd paper-
$(PAPER
); $(MAKE
) tut.
dvi)
123 (cd paper-
$(PAPER
); $(MAKE
) api.pdf
)
126 (cd paper-
$(PAPER
); $(MAKE
) ext.pdf
)
129 (cd paper-
$(PAPER
); $(MAKE
) lib.pdf
)
132 (cd paper-
$(PAPER
); $(MAKE
) mac.pdf
)
135 (cd paper-
$(PAPER
); $(MAKE
) ref.pdf
)
138 (cd paper-
$(PAPER
); $(MAKE
) tut.pdf
)
141 # The remaining part of the Makefile is concerned with various
142 # conversions, as described above. See also the README file.
145 (cd
$(INFODIR
); $(MAKE
))
147 # Targets to convert the manuals to HTML using Nikos Drakos' LaTeX to
148 # HTML converter. For more info on this program, see
149 # <URL:http://cbl.leeds.ac.uk/nikos/tex2html/doc/latex2html/latex2html.html>.
151 # Note that LaTeX2HTML inserts references to an icons directory in
152 # each page that it generates. I have placed a copy of this directory
153 # in the distribution to simplify the process of creating a
154 # self-contained HTML distribution; for this purpose I have also added
155 # a (trivial) index.html. Change the definition of $ICONSERVER in
156 # perl/l2hinit.perl to use a different location for the icons directory.
158 # If you have the standard LaTeX2HTML icons installed, the versions shipped
159 # with this documentation should be stored in a separate directory and used
160 # instead. The standard set does *not* include all the icons used in the
161 # Python documentation.
164 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile
)
167 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile api
)
170 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ext
)
173 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile lib
)
176 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile mac
)
179 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile ref
)
182 (cd
$(HTMLDIR
); $(MAKE
) PAPER
=$(PAPER
) -f ..
/html
/Makefile tut
)
185 # webchecker needs an extra flag to process the huge index from the libref
187 (cd
$(HTMLDIR
); $(MAKE
) -f ..
/html
/Makefile webcheck
)
190 # Release packaging targets:
192 info-
$(RELEASE
).tgz
: info
193 (cd
$(INFODIR
); tar cf
- README python.
dir python-???.
info*) \
196 latex-
$(RELEASE
).tgz
:
197 $(TOOLSDIR
)/mktarball.sh
$(RELEASE
)
199 pdf-
$(PAPER
)-$(RELEASE
).tgz
: pdf
200 (cd paper-
$(PAPER
); tar cf
- *.pdf
) | gzip
-9 >$@
202 postscript-
$(PAPER
)-$(RELEASE
).tgz
: ps
203 (cd paper-
$(PAPER
); $(MAKE
) README
)
204 (cd paper-
$(PAPER
); tar cf
- *.ps README
) | gzip
-9 >$@
206 html-
$(RELEASE
).tgz
: html
207 (cd
$(HTMLDIR
); tar cf
- index.html ???
/???.css ???
/*.html
*/*.gif
) \
210 # convenience targets:
212 tarhtml
: html-
$(RELEASE
).tgz
213 tarinfo
: info-
$(RELEASE
).tgz
214 tarps
: postscript-
$(PAPER
)-$(RELEASE
).tgz
215 tarpdf
: pdf-
$(PAPER
)-$(RELEASE
).tgz
216 tarlatex
: latex-
$(RELEASE
).tgz
218 tarballs
: tarpdf tarps tarhtml tarinfo tarlatex
221 # Housekeeping targets
223 # Remove temporary files; all except the following:
224 # - sources: .tex, .bib, .sty, *.cls
225 # - useful results: .dvi, .pdf, .ps, .texi, .info
227 (cd paper-
$(PAPER
); $(MAKE
) clean)
228 (cd
$(HTMLDIR
); $(MAKE
) clean)
229 (cd
$(INFODIR
); $(MAKE
) clean)
232 (cd
$(HTMLDIR
); $(MAKE
) clean)
234 # Remove temporaries as well as final products
236 (cd
$(HTMLDIR
); $(MAKE
) clobber)
237 rm -f html-
$(RELEASE
).tgz info-
$(RELEASE
).tgz
238 rm -f pdf-
$(RELEASE
).tgz postscript-
$(RELEASE
).tgz
239 rm -f latex-
$(RELEASE
).tgz
240 (cd paper-
$(PAPER
); $(MAKE
) clobber)
241 (cd
$(HTMLDIR
); $(MAKE
) clobber)
242 (cd
$(INFODIR
); $(MAKE
) clobber)