Makefile (4116B)
1 # Makefile for Sphinx documentation 2 # 3 # You can set these variables from the command line. 4 SPHINXOPTS = 5 SPHINXBUILD = sphinx-build 6 PAPER = 7 BUILDDIR = _build 8 9 # User-friendly check for sphinx-build 10 ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 11 $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 12 endif 13 14 # Internal variables. 15 PAPEROPT_a4 = -D latex_paper_size=a4 16 PAPEROPT_letter = -D latex_paper_size=letter 17 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 18 # the i18n builder cannot share the environment and doctrees with the others 19 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 20 21 .PHONY: help clean html json epub latex latexpdf text man doctest gettext 22 23 help: 24 @echo "Please use \`make <target>' where <target> is one of" 25 @echo " html to make a single large HTML file" 26 @echo " json to make JSON files" 27 @echo " epub to make an epub" 28 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 29 @echo " pdf to make LaTeX files and run them through pdflatex" 30 @echo " txt to make text files" 31 @echo " man to make manual pages" 32 @echo " texinfo to make Texinfo files" 33 @echo " info to make Texinfo files and run them through makeinfo" 34 @echo " gettext to make PO message catalogs" 35 @echo " xml to make Docutils-native XML files" 36 @echo " pseudoxml to make pseudoxml-XML files for display purposes" 37 @echo " doctest to run all doctests embedded in the documentation (if enabled)" 38 39 clean: 40 rm -rf $(BUILDDIR)/* 41 42 43 # The html-linked builder does not support caching, so we 44 # remove all cached state first. 45 html: 46 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 47 @echo 48 @echo "Build finished. The HTML page is in $(BUILDDIR)/html." 49 50 json: 51 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 52 @echo 53 @echo "Build finished; now you can process the JSON files." 54 55 epub: 56 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 57 @echo 58 @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 59 60 latex: 61 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 62 @echo 63 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 64 @echo "Run \`make' in that directory to run these through (pdf)latex" \ 65 "(use \`make latexpdf' here to do that automatically)." 66 67 pdf: 68 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf 69 @echo "Running LaTeX files through pdflatex..." 70 $(MAKE) -C $(BUILDDIR)/pdf all-pdf 71 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/pdf." 72 73 txt: 74 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/txt 75 @echo 76 @echo "Build finished. The text files are in $(BUILDDIR)/txt." 77 78 man: 79 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 80 @echo 81 @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 82 83 texinfo: 84 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 85 @echo 86 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 87 @echo "Run \`make' in that directory to run these through makeinfo" \ 88 "(use \`make info' here to do that automatically)." 89 90 info: 91 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/info 92 @echo "Running Texinfo files through makeinfo..." 93 make -C $(BUILDDIR)/texinfo info 94 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/info." 95 96 gettext: 97 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 98 @echo 99 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 100 101 doctest: 102 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 103 @echo "Testing of doctests in the sources finished, look at the " \ 104 "results in $(BUILDDIR)/doctest/output.txt." 105 106 xml: 107 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 108 @echo 109 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."