1 1.1 christos # Makefile for Sphinx documentation 2 1.1 christos # 3 1.1 christos 4 1.1 christos # You can set these variables from the command line. 5 1.1 christos SPHINXOPTS = 6 1.1 christos SPHINXBUILD = sphinx-build 7 1.1 christos PAPER = 8 1.1 christos BUILDDIR = build 9 1.1 christos 10 1.1 christos # User-friendly check for sphinx-build 11 1.1 christos ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 1.1 christos $(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/) 13 1.1 christos endif 14 1.1 christos 15 1.1 christos # Internal variables. 16 1.1 christos PAPEROPT_a4 = -D latex_paper_size=a4 17 1.1 christos PAPEROPT_letter = -D latex_paper_size=letter 18 1.1 christos ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 19 1.1 christos # the i18n builder cannot share the environment and doctrees with the others 20 1.1 christos I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source 21 1.1 christos 22 1.1 christos .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 23 1.1 christos 24 1.1 christos help: 25 1.1 christos @echo "Please use \`make <target>' where <target> is one of" 26 1.1 christos @echo " html to make standalone HTML files" 27 1.1 christos @echo " dirhtml to make HTML files named index.html in directories" 28 1.1 christos @echo " singlehtml to make a single large HTML file" 29 1.1 christos @echo " pickle to make pickle files" 30 1.1 christos @echo " json to make JSON files" 31 1.1 christos @echo " htmlhelp to make HTML files and a HTML help project" 32 1.1 christos @echo " qthelp to make HTML files and a qthelp project" 33 1.1 christos @echo " devhelp to make HTML files and a Devhelp project" 34 1.1 christos @echo " epub to make an epub" 35 1.1 christos @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 36 1.1 christos @echo " latexpdf to make LaTeX files and run them through pdflatex" 37 1.1 christos @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" 38 1.1 christos @echo " text to make text files" 39 1.1 christos @echo " man to make manual pages" 40 1.1 christos @echo " texinfo to make Texinfo files" 41 1.1 christos @echo " info to make Texinfo files and run them through makeinfo" 42 1.1 christos @echo " gettext to make PO message catalogs" 43 1.1 christos @echo " changes to make an overview of all changed/added/deprecated items" 44 1.1 christos @echo " xml to make Docutils-native XML files" 45 1.1 christos @echo " pseudoxml to make pseudoxml-XML files for display purposes" 46 1.1 christos @echo " linkcheck to check all external links for integrity" 47 1.1 christos @echo " doctest to run all doctests embedded in the documentation (if enabled)" 48 1.1 christos 49 1.1 christos clean: 50 1.1 christos rm -rf $(BUILDDIR)/* 51 1.1 christos 52 1.1 christos html: 53 1.1 christos $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 54 1.1 christos @echo 55 1.1 christos @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 56 1.1 christos 57 1.1 christos dirhtml: 58 1.1 christos $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 59 1.1 christos @echo 60 1.1 christos @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 61 1.1 christos 62 1.1 christos singlehtml: 63 1.1 christos $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 64 1.1 christos @echo 65 1.1 christos @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 66 1.1 christos 67 1.1 christos pickle: 68 1.1 christos $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 69 1.1 christos @echo 70 1.1 christos @echo "Build finished; now you can process the pickle files." 71 1.1 christos 72 1.1 christos json: 73 1.1 christos $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 74 1.1 christos @echo 75 1.1 christos @echo "Build finished; now you can process the JSON files." 76 1.1 christos 77 1.1 christos htmlhelp: 78 1.1 christos $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 79 1.1 christos @echo 80 1.1 christos @echo "Build finished; now you can run HTML Help Workshop with the" \ 81 1.1 christos ".hhp project file in $(BUILDDIR)/htmlhelp." 82 1.1 christos 83 1.1 christos qthelp: 84 1.1 christos $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 85 1.1 christos @echo 86 1.1 christos @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 87 1.1 christos ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 88 1.1 christos @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/libcbor.qhcp" 89 1.1 christos @echo "To view the help file:" 90 1.1 christos @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/libcbor.qhc" 91 1.1 christos 92 1.1 christos devhelp: 93 1.1 christos $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 94 1.1 christos @echo 95 1.1 christos @echo "Build finished." 96 1.1 christos @echo "To view the help file:" 97 1.1 christos @echo "# mkdir -p $$HOME/.local/share/devhelp/libcbor" 98 1.1 christos @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/libcbor" 99 1.1 christos @echo "# devhelp" 100 1.1 christos 101 1.1 christos epub: 102 1.1 christos $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 103 1.1 christos @echo 104 1.1 christos @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 105 1.1 christos 106 1.1 christos latex: 107 1.1 christos $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 108 1.1 christos @echo 109 1.1 christos @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 110 1.1 christos @echo "Run \`make' in that directory to run these through (pdf)latex" \ 111 1.1 christos "(use \`make latexpdf' here to do that automatically)." 112 1.1 christos 113 1.1 christos latexpdf: 114 1.1 christos $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 115 1.1 christos @echo "Running LaTeX files through pdflatex..." 116 1.1 christos $(MAKE) -C $(BUILDDIR)/latex all-pdf 117 1.1 christos @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 118 1.1 christos 119 1.1 christos latexpdfja: 120 1.1 christos $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 121 1.1 christos @echo "Running LaTeX files through platex and dvipdfmx..." 122 1.1 christos $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja 123 1.1 christos @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 124 1.1 christos 125 1.1 christos text: 126 1.1 christos $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 127 1.1 christos @echo 128 1.1 christos @echo "Build finished. The text files are in $(BUILDDIR)/text." 129 1.1 christos 130 1.1 christos man: 131 1.1 christos $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 132 1.1 christos @echo 133 1.1 christos @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 134 1.1 christos 135 1.1 christos texinfo: 136 1.1 christos $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 137 1.1 christos @echo 138 1.1 christos @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 139 1.1 christos @echo "Run \`make' in that directory to run these through makeinfo" \ 140 1.1 christos "(use \`make info' here to do that automatically)." 141 1.1 christos 142 1.1 christos info: 143 1.1 christos $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 144 1.1 christos @echo "Running Texinfo files through makeinfo..." 145 1.1 christos make -C $(BUILDDIR)/texinfo info 146 1.1 christos @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 147 1.1 christos 148 1.1 christos gettext: 149 1.1 christos $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 150 1.1 christos @echo 151 1.1 christos @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 152 1.1 christos 153 1.1 christos changes: 154 1.1 christos $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 155 1.1 christos @echo 156 1.1 christos @echo "The overview file is in $(BUILDDIR)/changes." 157 1.1 christos 158 1.1 christos linkcheck: 159 1.1 christos $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 160 1.1 christos @echo 161 1.1 christos @echo "Link check complete; look for any errors in the above output " \ 162 1.1 christos "or in $(BUILDDIR)/linkcheck/output.txt." 163 1.1 christos 164 1.1 christos doctest: 165 1.1 christos $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 166 1.1 christos @echo "Testing of doctests in the sources finished, look at the " \ 167 1.1 christos "results in $(BUILDDIR)/doctest/output.txt." 168 1.1 christos 169 1.1 christos xml: 170 1.1 christos $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml 171 1.1 christos @echo 172 1.1 christos @echo "Build finished. The XML files are in $(BUILDDIR)/xml." 173 1.1 christos 174 1.1 christos pseudoxml: 175 1.1 christos $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml 176 1.1 christos @echo 177 1.1 christos @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." 178 1.1 christos 179 1.1 christos livehtml: html 180 1.1 christos sphinx-autobuild -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 181