1 | # Makefile for Sphinx LaTeX output
|
---|
2 |
|
---|
3 | ALLDOCS = $(basename $(wildcard *.tex))
|
---|
4 | ALLPDF = $(addsuffix .pdf,$(ALLDOCS))
|
---|
5 | ALLDVI = $(addsuffix .dvi,$(ALLDOCS))
|
---|
6 |
|
---|
7 | # Prefix for archive names
|
---|
8 | ARCHIVEPRREFIX =
|
---|
9 | # Additional LaTeX options
|
---|
10 | LATEXOPTS =
|
---|
11 |
|
---|
12 | all: $(ALLPDF)
|
---|
13 | all-pdf: $(ALLPDF)
|
---|
14 | all-dvi: $(ALLDVI)
|
---|
15 | all-ps: all-dvi
|
---|
16 | for f in *.dvi; do dvips $$f; done
|
---|
17 |
|
---|
18 | zip: all-$(FMT)
|
---|
19 | mkdir $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
20 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
21 | zip -q -r -9 $(ARCHIVEPREFIX)docs-$(FMT).zip $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
22 | rm -r $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
23 |
|
---|
24 | tar: all-$(FMT)
|
---|
25 | mkdir $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
26 | cp $(ALLPDF) $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
27 | tar cf $(ARCHIVEPREFIX)docs-$(FMT).tar $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
28 | rm -r $(ARCHIVEPREFIX)docs-$(FMT)
|
---|
29 |
|
---|
30 | bz2: tar
|
---|
31 | bzip2 -9 -k $(ARCHIVEPREFIX)docs-$(FMT).tar
|
---|
32 |
|
---|
33 | # The number of LaTeX runs is quite conservative, but I don't expect it
|
---|
34 | # to get run often, so the little extra time won't hurt.
|
---|
35 | %.dvi: %.tex
|
---|
36 | latex $(LATEXOPTS) '$<'
|
---|
37 | latex $(LATEXOPTS) '$<'
|
---|
38 | latex $(LATEXOPTS) '$<'
|
---|
39 | -makeindex -s python.ist '$(basename $<).idx'
|
---|
40 | latex $(LATEXOPTS) '$<'
|
---|
41 | latex $(LATEXOPTS) '$<'
|
---|
42 |
|
---|
43 | %.pdf: %.tex
|
---|
44 | pdflatex $(LATEXOPTS) '$<'
|
---|
45 | pdflatex $(LATEXOPTS) '$<'
|
---|
46 | pdflatex $(LATEXOPTS) '$<'
|
---|
47 | -makeindex -s python.ist '$(basename $<).idx'
|
---|
48 | pdflatex $(LATEXOPTS) '$<'
|
---|
49 | pdflatex $(LATEXOPTS) '$<'
|
---|
50 |
|
---|
51 | clean:
|
---|
52 | rm -f *.pdf *.dvi *.ps
|
---|
53 | rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla
|
---|
54 |
|
---|
55 | .PHONY: all all-pdf all-dvi all-ps clean
|
---|
56 |
|
---|