Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f295113

Browse files
committed
Cleaned out some more cruft.
Added some new cruft. For some of the "big" targets, force things to happen in the "right" subdirectory, i.e., "make" will build the DVI and PostScript files in the paper-letter/ directory, and "make PAPER=a4" will build DVI and PostScript files in the paper-a4/ directory. Probably still needs some restructuring.
1 parent a34f7e6 commit f295113

1 file changed

Lines changed: 76 additions & 60 deletions

File tree

Doc/Makefile

Lines changed: 76 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,24 @@
44
# See also the README file.
55
#
66
# This is a bit of a mess. The main documents are:
7-
# tut -- Tutorial (file tut.tex)
8-
# lib -- Library Reference (file lib.tex, inputs lib*.tex)
9-
# ext -- Extending and Embedding (file ext.tex)
7+
# tut -- Tutorial
8+
# ref -- Python Reference Manual
9+
# lib -- Library Reference
10+
# ext -- Extending and Embedding
1011
# api -- Python-C API Reference
1112
#
12-
# The Reference Manual is now maintained as a FrameMaker document.
13-
# See the subdirectory ref; PostScript is included as ref/ref.ps.
14-
# (In the future, the Tutorial will also be converted to FrameMaker;
15-
# the other documents will be maintained in a text format such
16-
# as LaTeX or perhaps TIM.)
13+
# The latex sources for each of these documents are in subdirectories
14+
# with the three-letter designations above as the directory names.
1715
#
1816
# The main target "make all" creates DVI and PostScript for these
1917
# four. You can also do "make lib" (etc.) to process individual
2018
# documents.
2119
#
22-
# There's one local style file: python.sty. This defines a number
23-
# of macros that are similar in name and intent as macros in Texinfo
24-
# (e.g. \code{...} and \emph{...}), as well as a number of
25-
# environments for formatting function and data definitions, also in
26-
# the style of Texinfo.
20+
# The document classes and styles are in the texinputs/ directory.
21+
# These define a number of macros that are similar in name and intent
22+
# as macros in Texinfo (e.g. \code{...} and \emph{...}), as well as a
23+
# number of environments for formatting function and data definitions,
24+
# also in the style of Texinfo.
2725
#
2826
# Everything is processed by LaTeX. The following tools are used:
2927
# latex
@@ -40,19 +38,23 @@
4038
# Additional targets attempt to convert selected LaTeX sources to
4139
# various other formats. These are generally site specific because
4240
# the tools used are all but universal. These targets are:
43-
# l2h -- convert tut, lib, ext, api from LaTeX to HTML
41+
# l2h -- convert tut, ref, lib, ext, api from LaTeX to HTML
4442
# See the README file for more info on these targets.
4543

4644
# Customizations -- you *may* have to edit these
4745

46+
# you could set this to a4
47+
PAPER=letter
48+
4849
# Where are the various programs?
4950
LATEX= latex
5051
PDFLATEX= pdflatex
5152
DVIPS= dvips -N0
52-
DISTILL= distill
5353
KPSEWHICH= TEXINPUTS=$(TEXINPUTS) kpsewhich
5454
MAKEINDEX= makeindex -s $(srcdir)/texinputs/myindex.ist
55+
ACROREAD= acroread
5556
L2HARGS=
57+
PYTHON= python
5658
WEBCHECKER= $(PYTHON) $(srcdir)/../Tools/webchecker/webchecker.py
5759

5860
# Install destination -- not used now but might be useful some time...
@@ -63,7 +65,6 @@ DOCDESTDIR= $LIBDEST/doc
6365

6466
# These is only used for .info generation:
6567
EMACS= emacs
66-
PYTHON= python
6768
MAKEINFO= makeinfo
6869
PARTPARSE= $(PYTHON) $(srcdir)/tools/partparse.py
6970

@@ -80,67 +81,59 @@ INFOFILES= python-lib.info
8081
PDFFILES= api.pdf ext.pdf lib.pdf ref.pdf tut.pdf
8182
PSFILES= api.ps ext.ps lib.ps ref.ps tut.ps
8283

83-
MANSTYLES=texinputs/fncychap.sty texinputs/manual.cls \
84-
texinputs/python.sty texinputs/myindex.ist
85-
8684
# Be careful when messing with this one!
8785
TEXINPUTS= .:$(srcdir)/texinputs:
8886

8987
MKDVI= TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkdvi.sh
88+
MKHTML= TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh
89+
MKPDF= TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkdvi.sh --pdf
9090

9191
# Main target
92-
all: all-ps
92+
all:
93+
94+
all-dvi:
95+
(cd paper-$(PAPER); $(MAKE) all-dvi)
9396

94-
world: all-ps all-pdf l2h tarballs
97+
all-pdf:
98+
(cd paper-$(PAPER); $(MAKE) all-pdf)
9599

96-
all-dvi: $(DVIFILES)
97-
all-pdf: $(PDFFILES)
98-
all-ps: $(PSFILES)
100+
all-ps:
101+
(cd paper-$(PAPER); $(MAKE) all-ps)
99102

100-
# This target gets both the PDF and PS files updated; the all-pdf target
101-
# above doesn't ensure that both are done if the "alternate" rule (using
102-
# pdflatex) for PDF generation is used.
103+
world: do-ps do-pdf l2h tarballs
104+
105+
do-dvi: $(DVIFILES)
106+
do-pdf: $(PDFFILES)
107+
do-ps: $(PSFILES)
108+
109+
# This target gets both the PDF and PS files updated.
103110
#
104111
all-formats: $(PSFILES) $(PDFFILES)
105112

106-
# Individual document fake targets
107-
tut: tut.ps
108-
lib: lib.ps
109-
ext: ext.ps
110-
api: api.ps
111-
112113

113114
# Rules to build PostScript and PDF formats
114-
.SUFFIXES: .dvi .ps .pdf .tex
115+
.SUFFIXES: .dvi .ps .pdf
115116

116117
.dvi.ps:
117118
$(DVIPS) -o $@ $<
118119

119-
#.ps.pdf:
120-
# $(DISTILL) $<
120+
#.pdf.ps:
121+
# $(ACROREAD) -toPostScript $<
121122

122-
# An alternate formulation of PDF creation; requires latex format with
123-
# pdftex. To use this instead of the Acrobat distiller solution, comment
124-
# out the above .ps.pdf rule and uncomment this rule. This was tested
125-
# using a pre-release of the teTeX distribution. See
126-
# http://www.tug.org/tetex/ for more information on getting & using teTeX.
127-
# This rule avoids creation of the intermediate PostScript files and uses
128-
# only free software.
129-
#
130-
$(PDFFILES): $(srcdir)/tools/toc2bkm.py
131-
.dvi.pdf:
132-
TEXINPUTS=$(srcdir)/$*:$(TEXINPUTS) $(PDFLATEX) $*
133-
$(PYTHON) $(srcdir)/tools/toc2bkm.py $*
134-
TEXINPUTS=$(srcdir)/$*:$(TEXINPUTS) $(PDFLATEX) $*
135123

136124
# Dependencies
125+
# We really need some support of dependency generator for this...
126+
127+
MANSTYLES=texinputs/fncychap.sty texinputs/manual.cls \
128+
texinputs/python.sty texinputs/myindex.ist
129+
137130
COMMONTEX=$(MANSTYLES) texinputs/copyright.tex texinputs/boilerplate.tex
138-
COMMONPERL=perl/manual.perl perl/python.perl
139131

140132
$(DVIFILES): tools/fix_hack tools/mkdvi.sh $(COMMONTEX)
133+
$(PDFFILES): tools/fix_hack tools/mkdvi.sh $(COMMONTEX)
141134

142-
ref.dvi: ref/ref1.tex ref/ref2.tex ref/ref3.tex ref/ref4.tex \
143-
ref/ref5.tex ref/ref6.tex ref/ref7.tex ref/ref8.tex
135+
REFFILES = ref/ref1.tex ref/ref2.tex ref/ref3.tex ref/ref4.tex \
136+
ref/ref5.tex ref/ref6.tex ref/ref7.tex ref/ref8.tex
144137

145138
# LaTeX source files for the Python Library Reference
146139
LIBFILES = lib/lib.tex \
@@ -198,22 +191,44 @@ lib.dvi: tools/indfix.py $(LIBFILES)
198191
$(srcdir)/tools/indfix.py $*.ind
199192
TEXINPUTS=$(srcdir)/lib:$(TEXINPUTS) $(LATEX) $*
200193

194+
lib.pdf: tools/indfix.py $(LIBFILES)
195+
$(srcdir)/tools/newind.py >$*.ind
196+
$(srcdir)/tools/newind.py modindex >mod$*.ind
197+
TEXINPUTS=$(srcdir)/lib:$(TEXINPUTS) $(PDFLATEX) $*
198+
$(MAKEINDEX) mod$*.idx
199+
$(srcdir)/tools/fix_hack $*.idx
200+
$(MAKEINDEX) $*.idx
201+
$(srcdir)/tools/indfix.py $*.ind
202+
TEXINPUTS=$(srcdir)/lib:$(TEXINPUTS) $(PDFLATEX) $*
203+
201204
# Python/C API Reference Manual
202205
api.dvi: api/api.tex
203206
$(MKDVI) api
204207

208+
api.pdf: api/api.tex
209+
$(MKPDF) api
210+
205211
# Extending and Embedding the Python Interpreter
206212
ext.dvi: ext/ext.tex
207213
$(MKDVI) ext
208214

215+
ext.pdf: ext/ext.tex
216+
$(MKPDF) ext
217+
209218
# Python Reference Manual
210-
ref.dvi: ref/ref.tex
219+
ref.dvi: $(REFFILES)
211220
$(MKDVI) ref
212221

222+
ref.pdf: $(REFFILES)
223+
$(MKPDF) ref
224+
213225
# Python Tutorial
214226
tut.dvi: tut/tut.tex
215227
$(MKDVI) tut
216228

229+
tut.pdf: tut/tut.tex
230+
$(MKPDF) tut
231+
217232

218233
# The remaining part of the Makefile is concerned with various
219234
# conversions, as described above. See also the README file.
@@ -226,13 +241,13 @@ tut.dvi: tut/tut.tex
226241
# least the info file gets generated.
227242

228243
lib1.texi: $(LIBFILES) texipre.dat texipost.dat tools/partparse.py
229-
$(PARTPARSE) -o $@ `tools/whichlibs`
244+
$(PARTPARSE) -o $@ `$(srcdir)/tools/whichlibs`
230245
sed 's/"{\\}n{\\}n/"\\n\\n/' $@ >temp.texi
231246
mv temp.texi $@
232247

233248
python-lib.texi: lib1.texi tools/fix.el
234249
cp lib1.texi temp.texi
235-
$(EMACS) -batch -l tools/fix.el -f save-buffer -kill
250+
$(EMACS) -batch -l $(srcdir)/tools/fix.el -f save-buffer -kill
236251
mv temp.texi $@
237252

238253
python-lib.info: python-lib.texi
@@ -258,26 +273,27 @@ lib.texi: python-lib.texi
258273
# a (trivial) index.html. Change the definition of $ICONSERVER in
259274
# perl/l2hinit.perl to use a different location for the icons directory.
260275

276+
COMMONPERL=perl/manual.perl perl/python.perl
261277

262278
l2h:
263279
(cd html; $(MAKE))
264280

265281
l2hapi: $(COMMONPERL)
266-
TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh api $(L2HARGS)
282+
$(MKHTML) api $(L2HARGS)
267283

268284
l2hext: $(COMMONPERL)
269-
TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh ext $(L2HARGS)
285+
$(MKHTML) ext $(L2HARGS)
270286

271287
l2hlib: $(COMMONPERL)
272288
$(srcdir)/tools/fix_libaux.sed <`$(KPSEWHICH) lib.aux` >lib1.aux
273289
mv lib1.aux `$(KPSEWHICH) lib.aux`
274-
TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh lib $(L2HARGS)
290+
$(MKHTML) lib $(L2HARGS)
275291

276292
l2href: $(COMMONPERL)
277-
TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh ref $(L2HARGS)
293+
$(MKHTML) ref $(L2HARGS)
278294

279295
l2htut: $(COMMONPERL)
280-
TEXINPUTS=$(TEXINPUTS) $(srcdir)/tools/mkhtml.sh tut $(L2HARGS)
296+
$(MKHTML) tut $(L2HARGS)
281297

282298
# webchecker needs an extra flag to process the huge index from the libref
283299
webcheck:

0 commit comments

Comments
 (0)