1*f4a2713aSLionel Sambuc# Makefile for Sphinx documentation 2*f4a2713aSLionel Sambuc# 3*f4a2713aSLionel Sambuc 4*f4a2713aSLionel Sambuc# You can set these variables from the command line. 5*f4a2713aSLionel SambucSPHINXOPTS = 6*f4a2713aSLionel SambucSPHINXBUILD = sphinx-build 7*f4a2713aSLionel SambucPAPER = 8*f4a2713aSLionel SambucBUILDDIR = _build 9*f4a2713aSLionel Sambuc 10*f4a2713aSLionel Sambuc# Internal variables. 11*f4a2713aSLionel SambucPAPEROPT_a4 = -D latex_paper_size=a4 12*f4a2713aSLionel SambucPAPEROPT_letter = -D latex_paper_size=letter 13*f4a2713aSLionel SambucALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14*f4a2713aSLionel Sambuc# the i18n builder cannot share the environment and doctrees with the others 15*f4a2713aSLionel SambucI18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext default 18*f4a2713aSLionel Sambuc 19*f4a2713aSLionel Sambucdefault: html 20*f4a2713aSLionel Sambuc 21*f4a2713aSLionel Sambuchelp: 22*f4a2713aSLionel Sambuc @echo "Please use \`make <target>' where <target> is one of" 23*f4a2713aSLionel Sambuc @echo " html to make standalone HTML files" 24*f4a2713aSLionel Sambuc @echo " dirhtml to make HTML files named index.html in directories" 25*f4a2713aSLionel Sambuc @echo " singlehtml to make a single large HTML file" 26*f4a2713aSLionel Sambuc @echo " pickle to make pickle files" 27*f4a2713aSLionel Sambuc @echo " json to make JSON files" 28*f4a2713aSLionel Sambuc @echo " htmlhelp to make HTML files and a HTML help project" 29*f4a2713aSLionel Sambuc @echo " qthelp to make HTML files and a qthelp project" 30*f4a2713aSLionel Sambuc @echo " devhelp to make HTML files and a Devhelp project" 31*f4a2713aSLionel Sambuc @echo " epub to make an epub" 32*f4a2713aSLionel Sambuc @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 33*f4a2713aSLionel Sambuc @echo " latexpdf to make LaTeX files and run them through pdflatex" 34*f4a2713aSLionel Sambuc @echo " text to make text files" 35*f4a2713aSLionel Sambuc @echo " man to make manual pages" 36*f4a2713aSLionel Sambuc @echo " texinfo to make Texinfo files" 37*f4a2713aSLionel Sambuc @echo " info to make Texinfo files and run them through makeinfo" 38*f4a2713aSLionel Sambuc @echo " gettext to make PO message catalogs" 39*f4a2713aSLionel Sambuc @echo " changes to make an overview of all changed/added/deprecated items" 40*f4a2713aSLionel Sambuc @echo " linkcheck to check all external links for integrity" 41*f4a2713aSLionel Sambuc @echo " doctest to run all doctests embedded in the documentation (if enabled)" 42*f4a2713aSLionel Sambuc 43*f4a2713aSLionel Sambucclean: 44*f4a2713aSLionel Sambuc -rm -rf $(BUILDDIR)/* 45*f4a2713aSLionel Sambuc 46*f4a2713aSLionel Sambuchtml: 47*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 48*f4a2713aSLionel Sambuc @echo 49*f4a2713aSLionel Sambuc @# FIXME: Remove this `cp` once HTML->Sphinx transition is completed. 50*f4a2713aSLionel Sambuc @# Kind of a hack, but HTML-formatted docs are on the way out anyway. 51*f4a2713aSLionel Sambuc @echo "Copying legacy HTML-formatted docs into $(BUILDDIR)/html" 52*f4a2713aSLionel Sambuc @cp -a *.html $(BUILDDIR)/html 53*f4a2713aSLionel Sambuc @# FIXME: What we really need is a way to specify redirects, so that 54*f4a2713aSLionel Sambuc @# we can just redirect to a reST'ified version of this document. 55*f4a2713aSLionel Sambuc @# PR14714 is tracking the issue of redirects. 56*f4a2713aSLionel Sambuc @cp -a Block-ABI-Apple.txt $(BUILDDIR)/html 57*f4a2713aSLionel Sambuc @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 58*f4a2713aSLionel Sambuc 59*f4a2713aSLionel Sambucdirhtml: 60*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 61*f4a2713aSLionel Sambuc @echo 62*f4a2713aSLionel Sambuc @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 63*f4a2713aSLionel Sambuc 64*f4a2713aSLionel Sambucsinglehtml: 65*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 66*f4a2713aSLionel Sambuc @echo 67*f4a2713aSLionel Sambuc @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 68*f4a2713aSLionel Sambuc 69*f4a2713aSLionel Sambucpickle: 70*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 71*f4a2713aSLionel Sambuc @echo 72*f4a2713aSLionel Sambuc @echo "Build finished; now you can process the pickle files." 73*f4a2713aSLionel Sambuc 74*f4a2713aSLionel Sambucjson: 75*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 76*f4a2713aSLionel Sambuc @echo 77*f4a2713aSLionel Sambuc @echo "Build finished; now you can process the JSON files." 78*f4a2713aSLionel Sambuc 79*f4a2713aSLionel Sambuchtmlhelp: 80*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 81*f4a2713aSLionel Sambuc @echo 82*f4a2713aSLionel Sambuc @echo "Build finished; now you can run HTML Help Workshop with the" \ 83*f4a2713aSLionel Sambuc ".hhp project file in $(BUILDDIR)/htmlhelp." 84*f4a2713aSLionel Sambuc 85*f4a2713aSLionel Sambucqthelp: 86*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 87*f4a2713aSLionel Sambuc @echo 88*f4a2713aSLionel Sambuc @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 89*f4a2713aSLionel Sambuc ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 90*f4a2713aSLionel Sambuc @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Clang.qhcp" 91*f4a2713aSLionel Sambuc @echo "To view the help file:" 92*f4a2713aSLionel Sambuc @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Clang.qhc" 93*f4a2713aSLionel Sambuc 94*f4a2713aSLionel Sambucdevhelp: 95*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 96*f4a2713aSLionel Sambuc @echo 97*f4a2713aSLionel Sambuc @echo "Build finished." 98*f4a2713aSLionel Sambuc @echo "To view the help file:" 99*f4a2713aSLionel Sambuc @echo "# mkdir -p $$HOME/.local/share/devhelp/Clang" 100*f4a2713aSLionel Sambuc @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Clang" 101*f4a2713aSLionel Sambuc @echo "# devhelp" 102*f4a2713aSLionel Sambuc 103*f4a2713aSLionel Sambucepub: 104*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 105*f4a2713aSLionel Sambuc @echo 106*f4a2713aSLionel Sambuc @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 107*f4a2713aSLionel Sambuc 108*f4a2713aSLionel Sambuclatex: 109*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 110*f4a2713aSLionel Sambuc @echo 111*f4a2713aSLionel Sambuc @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 112*f4a2713aSLionel Sambuc @echo "Run \`make' in that directory to run these through (pdf)latex" \ 113*f4a2713aSLionel Sambuc "(use \`make latexpdf' here to do that automatically)." 114*f4a2713aSLionel Sambuc 115*f4a2713aSLionel Sambuclatexpdf: 116*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 117*f4a2713aSLionel Sambuc @echo "Running LaTeX files through pdflatex..." 118*f4a2713aSLionel Sambuc $(MAKE) -C $(BUILDDIR)/latex all-pdf 119*f4a2713aSLionel Sambuc @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 120*f4a2713aSLionel Sambuc 121*f4a2713aSLionel Sambuctext: 122*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 123*f4a2713aSLionel Sambuc @echo 124*f4a2713aSLionel Sambuc @echo "Build finished. The text files are in $(BUILDDIR)/text." 125*f4a2713aSLionel Sambuc 126*f4a2713aSLionel Sambucman: 127*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 128*f4a2713aSLionel Sambuc @echo 129*f4a2713aSLionel Sambuc @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 130*f4a2713aSLionel Sambuc 131*f4a2713aSLionel Sambuctexinfo: 132*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 133*f4a2713aSLionel Sambuc @echo 134*f4a2713aSLionel Sambuc @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 135*f4a2713aSLionel Sambuc @echo "Run \`make' in that directory to run these through makeinfo" \ 136*f4a2713aSLionel Sambuc "(use \`make info' here to do that automatically)." 137*f4a2713aSLionel Sambuc 138*f4a2713aSLionel Sambucinfo: 139*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 140*f4a2713aSLionel Sambuc @echo "Running Texinfo files through makeinfo..." 141*f4a2713aSLionel Sambuc make -C $(BUILDDIR)/texinfo info 142*f4a2713aSLionel Sambuc @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 143*f4a2713aSLionel Sambuc 144*f4a2713aSLionel Sambucgettext: 145*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 146*f4a2713aSLionel Sambuc @echo 147*f4a2713aSLionel Sambuc @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 148*f4a2713aSLionel Sambuc 149*f4a2713aSLionel Sambucchanges: 150*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 151*f4a2713aSLionel Sambuc @echo 152*f4a2713aSLionel Sambuc @echo "The overview file is in $(BUILDDIR)/changes." 153*f4a2713aSLionel Sambuc 154*f4a2713aSLionel Sambuclinkcheck: 155*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 156*f4a2713aSLionel Sambuc @echo 157*f4a2713aSLionel Sambuc @echo "Link check complete; look for any errors in the above output " \ 158*f4a2713aSLionel Sambuc "or in $(BUILDDIR)/linkcheck/output.txt." 159*f4a2713aSLionel Sambuc 160*f4a2713aSLionel Sambucdoctest: 161*f4a2713aSLionel Sambuc $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 162*f4a2713aSLionel Sambuc @echo "Testing of doctests in the sources finished, look at the " \ 163*f4a2713aSLionel Sambuc "results in $(BUILDDIR)/doctest/output.txt." 164