Debian Codegraph @

doc/Makefile

raw
1 # Makefile for Sphinx documentation
2
3 # You can set these variables from the command line.
4 SPHINXOPTS =
5 SPHINXBUILD = DOC_NAME=$* sphinx-build
6 PAPER =
7 BUILDDIR = build
8 SOURCEDIR = .
9
10 # Internal variables.
11 PAPEROPT_a4 = -D latex_paper_size=a4
12 PAPEROPT_letter = -D latex_paper_size=letter
13 ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) \
14 -c $(SOURCEDIR)/share \
15 -d $(BUILDDIR)/$*/doctrees \
16 $(SOURCEDIR)
17 DOC_LIST=aunit_cb
18 FMT_LIST=html pdf txt info
19
20 .PHONY: all help clean
21
22 all: $(foreach doc, $(DOC_LIST), $(doc).all)
23
24 help:
25 @echo "Please use \`make <target>' where <target> is one of"
26 @echo " DOC_NAME.html to make standalone HTML files"
27 @echo " DOC_NAME.pdf to make LaTeX files and run them through pdflatex"
28 @echo " DOC_NAME.txt to make text files"
29 @echo " DOC_NAME.texinfo to make Texinfo files"
30 @echo " DOC_NAME.info to make info files"
31 @echo " DOC_NAME.all to build DOC_NAME for all previous formats"
32 @echo " all to build all documentations in all formats"
33 @echo " html-all same as previous rule but only for HTML format"
34 @echo " pdf-all same as previous rule but only for PDF format"
35 @echo " txt-all same as previous rule but only for text format"
36 @echo " texinfo-all same as previous rule but only for texinfo format"
37 @echo " info-all same as previous rule but only for info format"
38 @echo ""
39 @echo "DOC_NAME should be a documentation name in the following list:"
40 @echo " $(DOC_LIST)"
41 @echo ""
42 @echo "source and location can be overriden using SOURCEDIR and BUILDDIR variables"
43
44 clean:
45 -rm -rf $(BUILDDIR)/*/html \
46 $(BUILDDIR)/*/pdf \
47 $(BUILDDIR)/*/txt \
48 $(BUILDDIR)/*/info \
49 $(BUILDDIR)/*/doctrees \
50 share/__pycache__
51
52 %.html:
53 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/$*/html
54
55 %.pdf:
56 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/$*/pdf
57 $(MAKE) -C $(BUILDDIR)/$*/pdf all-pdf LATEXOPTS="-interaction=nonstopmode"
58
59 %.txt:
60 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/txt
61 $(MAKE) -C $(BUILDDIR)/$*/txt plaintext
62
63 %.info:
64 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/info
65 $(MAKE) -C $(BUILDDIR)/$*/info info
66
67 %.texinfo:
68 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/texinfo
69
70 html-all: $(foreach doc, $(DOC_LIST), $(doc).html)
71
72 pdf-all: $(foreach doc, $(DOC_LIST), $(doc).pdf)
73
74 txt-all: $(foreach doc, $(DOC_LIST), $(doc).txt)
75
76 texinfo-all: $(foreach doc, $(DOC_LIST), $(doc).texinfo)
77
78 %.all:
79 $(MAKE) $(foreach fmt, $(FMT_LIST), $*.$(fmt))