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