111
|
1 # Makefile for Sphinx documentation
|
|
2
|
|
3 # You can set these variables from the command line.
|
131
|
4 SPHINXOPTS = -W
|
111
|
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=gnat_rm gnat_ugn
|
|
18 FMT_LIST=html pdf txt info
|
|
19
|
|
20 .PHONY: help clean
|
|
21
|
|
22 help:
|
|
23 @echo "Please use \`make <target>' where <target> is one of"
|
|
24 @echo " DOC_NAME.html to make standalone HTML files"
|
|
25 @echo " DOC_NAME.pdf to make LaTeX files and run them through pdflatex"
|
|
26 @echo " DOC_NAME.txt to make text files"
|
|
27 @echo " DOC_NAME.info to make info files"
|
|
28 @echo " DOC_NAME.texinfo to make Texinfo files"
|
|
29 @echo " DOC_NAME.all to build DOC_NAME for all previous formats"
|
|
30 @echo " all to build all documentations in all formats"
|
|
31 @echo " html-all same as previous rule but only for HTML format"
|
|
32 @echo " pdf-all same as previous rule but only for PDF format"
|
|
33 @echo " txt-all same as previous rule but only for text format"
|
|
34 @echo " info-all same as previous rule but only for info format"
|
|
35 @echo " texinfo-all same as previous rule but only for texinfo format"
|
|
36 @echo ""
|
|
37 @echo "DOC_NAME should be a documentation name in the following list:"
|
|
38 @echo " $(DOC_LIST)"
|
|
39 @echo ""
|
|
40 @echo "source and location can be overridden using SOURCEDIR and BUILDDIR variables"
|
|
41
|
|
42 clean:
|
|
43 -rm -rf $(BUILDDIR)
|
|
44
|
|
45 %.html:
|
|
46 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/$*/html
|
|
47
|
|
48 %.pdf:
|
|
49 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/$*/pdf
|
|
50 $(MAKE) -C $(BUILDDIR)/$*/pdf all-pdf LATEXOPTS="-interaction=nonstopmode"
|
|
51
|
|
52 %.txt:
|
|
53 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/txt
|
|
54 $(MAKE) -C $(BUILDDIR)/$*/txt plaintext
|
|
55
|
|
56 %.info:
|
|
57 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/info
|
|
58 $(MAKE) -C $(BUILDDIR)/$*/info info
|
|
59
|
|
60 %.texinfo:
|
|
61 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/$*/texinfo
|
|
62 sed -e 's/^@dircategory/@dircategory GNU Ada Tools/g' < $(BUILDDIR)/$*/texinfo/$*.texi > $(BUILDDIR)/../../$*.texi
|
|
63
|
|
64 .PHONY: html-all
|
|
65 html-all: $(foreach doc, $(DOC_LIST), $(doc).html)
|
|
66
|
|
67 .PHONY: pdf-all
|
|
68 pdf-all: $(foreach doc, $(DOC_LIST), $(doc).pdf)
|
|
69
|
|
70 .PHONY: txt-all
|
|
71 txt-all: $(foreach doc, $(DOC_LIST), $(doc).txt)
|
|
72
|
|
73 .PHONY: info-all
|
|
74 info-all: $(foreach doc, $(DOC_LIST), $(doc).info)
|
|
75
|
|
76 .PHONY: texinfo-all
|
|
77 texinfo-all: $(foreach doc, $(DOC_LIST), $(doc).texinfo)
|
|
78
|
|
79 %.all:
|
|
80 $(MAKE) $(foreach fmt, $(FMT_LIST), $*.$(fmt))
|
|
81
|
|
82 .PHONY: all
|
|
83 all: $(foreach fmt, $(FMT_LIST), $(fmt)-all)
|