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