2011-05-23 14:51:31 +08:00
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
2013-10-11 23:23:17 +01:00
SPHINXLANG =
2014-11-20 15:24:02 -06:00
XELATEX = xelatex
2011-05-23 14:51:31 +08:00
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size = a4
PAPEROPT_letter = -D latex_paper_size = letter
2019-10-28 13:15:27 +00:00
ALLSPHINXOPTS = -d $( BUILDDIR) /doctrees $( PAPEROPT_$( PAPER) ) $( SPHINXOPTS) .
2013-10-10 21:49:40 -04:00
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $( PAPEROPT_$( PAPER) ) $( SPHINXOPTS) .
2011-05-23 14:51:31 +08:00
2024-07-30 14:49:42 -05:00
.PHONY : help clean check_sphinx -build html dirhtml singlehtml pickle json htmlhelp qthelp devhelp latex latexpdf text man changes linkcheck doctest
2011-05-23 14:51:31 +08:00
help :
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
2014-11-26 16:21:18 -06:00
@echo " pdf to make Salt-all.pdf and splitted pdf using xelatex"
2014-11-20 16:20:34 -06:00
@echo " cheatsheet to create salt-cheatsheet.pdf"
2011-05-23 14:51:31 +08:00
@echo " latexpdf to make LaTeX files and run them through pdflatex"
2013-10-10 21:49:40 -04:00
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
2011-05-23 14:51:31 +08:00
@echo " text to make text files"
@echo " man to make manual pages"
2013-10-10 21:49:40 -04:00
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
2011-05-23 14:51:31 +08:00
@echo " changes to make an overview of all changed/added/deprecated items"
2013-10-10 21:49:40 -04:00
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
2011-05-23 14:51:31 +08:00
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean :
2013-10-10 21:49:40 -04:00
rm -rf $( BUILDDIR) /*
2015-04-21 00:44:02 +01:00
test -d 'locale' && find locale/ -name *.mo -exec rm { } \; || true
2011-05-23 14:51:31 +08:00
2017-05-23 17:08:34 +02:00
# User-friendly check for sphinx-build
check_sphinx-build :
2019-02-22 11:31:35 -06:00
@which $( SPHINXBUILD) >/dev/null 2>& 1 || ( echo " 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://www.sphinx-doc.org/en/master/) " >& 2; false )
2017-05-23 17:08:34 +02:00
2019-10-28 13:15:27 +00:00
html : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b html $( ALLSPHINXOPTS) $( BUILDDIR) /html
@echo
@echo " Build finished. The HTML pages are in $( BUILDDIR) /html. "
2019-10-28 13:15:27 +00:00
dirhtml : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b dirhtml $( ALLSPHINXOPTS) $( BUILDDIR) /dirhtml
@echo
@echo " Build finished. The HTML pages are in $( BUILDDIR) /dirhtml. "
2019-10-28 13:15:27 +00:00
singlehtml : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b singlehtml $( ALLSPHINXOPTS) $( BUILDDIR) /singlehtml
@echo
@echo " Build finished. The HTML page is in $( BUILDDIR) /singlehtml. "
2019-10-28 13:15:27 +00:00
pickle : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b pickle $( ALLSPHINXOPTS) $( BUILDDIR) /pickle
@echo
@echo "Build finished; now you can process the pickle files."
2019-10-28 13:15:27 +00:00
json : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b json $( ALLSPHINXOPTS) $( BUILDDIR) /json
@echo
@echo "Build finished; now you can process the JSON files."
2019-10-28 13:15:27 +00:00
htmlhelp : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b htmlhelp $( ALLSPHINXOPTS) $( BUILDDIR) /htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
" .hhp project file in $( BUILDDIR) /htmlhelp. "
2019-10-28 13:15:27 +00:00
qthelp : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b qthelp $( ALLSPHINXOPTS) $( BUILDDIR) /qthelp
@echo
@echo "Build finished; now you can run " qcollectiongenerator" with the" \
" .qhcp project file in $( BUILDDIR) /qthelp, like this: "
@echo " # qcollectiongenerator $( BUILDDIR) /qthelp/Salt.qhcp "
@echo "To view the help file:"
@echo " # assistant -collectionFile $( BUILDDIR) /qthelp/Salt.qhc "
2019-10-28 13:15:27 +00:00
devhelp : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b devhelp $( ALLSPHINXOPTS) $( BUILDDIR) /devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo " # mkdir -p $$ HOME/.local/share/devhelp/Salt "
@echo " # ln -s $( BUILDDIR) /devhelp $$ HOME/.local/share/devhelp/Salt "
@echo "# devhelp"
2019-10-28 13:15:27 +00:00
latex : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
@echo
@echo " Build finished; the LaTeX files are in $( BUILDDIR) /latex. "
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
2019-10-28 13:15:27 +00:00
latexpdf : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
@echo "Running LaTeX files through pdflatex..."
2013-10-10 21:49:40 -04:00
$( MAKE) -C $( BUILDDIR) /latex all-pdf
@echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex. "
2019-10-28 13:15:27 +00:00
latexpdfja : check_sphinx -build
2013-10-10 21:49:40 -04:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$( MAKE) -C $( BUILDDIR) /latex all-pdf-ja
2011-05-23 14:51:31 +08:00
@echo " pdflatex finished; the PDF files are in $( BUILDDIR) /latex. "
2019-10-28 13:15:27 +00:00
pdf : check_sphinx -build
2014-11-26 16:21:18 -06:00
@if [ " $( XELATEX) " = "xelatex" ] || [ " x $( XELATEX) " = "x" ] ; then \
echo " The ' $( XELATEX) ' command was not found. " ; \
fi
2014-06-04 17:40:31 -06:00
$( SPHINXBUILD) -b latex $( ALLSPHINXOPTS) $( BUILDDIR) /latex
@echo "Running LaTeX files through xelatex..."
2019-09-18 16:49:11 -07:00
$( MAKE) -C $( BUILDDIR) /latex -i "PDFLATEX=latexmk" "LATEXMKOPTS=-xelatex -interaction=nonstopmode -f -quiet"
2014-06-04 17:40:31 -06:00
@echo " xelatex finished; the PDF files are in $( BUILDDIR) /latex. "
2019-10-28 13:15:27 +00:00
cheatsheet :
2014-11-20 16:20:34 -06:00
@echo "Running cheatsheet/salt.tex file through xelatex..."
2016-03-01 17:36:23 +02:00
cd cheatsheet && xelatex salt.tex && cp salt.pdf ../salt-cheatsheet.pdf
2014-11-20 16:20:34 -06:00
@echo "./salt-cheatsheet.pdf created."
2019-10-28 13:15:27 +00:00
text : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b text $( ALLSPHINXOPTS) $( BUILDDIR) /text
@echo
@echo " Build finished. The text files are in $( BUILDDIR) /text. "
2019-10-28 13:15:27 +00:00
man : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b man $( ALLSPHINXOPTS) $( BUILDDIR) /man
@echo
@echo " Build finished. The manual pages are in $( BUILDDIR) /man. "
2019-10-28 13:15:27 +00:00
texinfo : check_sphinx -build
2013-10-10 21:49:40 -04:00
$( SPHINXBUILD) -b texinfo $( ALLSPHINXOPTS) $( BUILDDIR) /texinfo
@echo
@echo " Build finished. The Texinfo files are in $( BUILDDIR) /texinfo. "
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
2019-10-28 13:15:27 +00:00
info : check_sphinx -build
2013-10-10 21:49:40 -04:00
$( SPHINXBUILD) -b texinfo $( ALLSPHINXOPTS) $( BUILDDIR) /texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $( BUILDDIR) /texinfo info
@echo " makeinfo finished; the Info files are in $( BUILDDIR) /texinfo. "
2019-10-28 13:15:27 +00:00
changes : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b changes $( ALLSPHINXOPTS) $( BUILDDIR) /changes
@echo
@echo " The overview file is in $( BUILDDIR) /changes. "
2017-05-23 17:08:34 +02:00
spelling : check_sphinx -build
2014-07-13 13:43:33 -05:00
$( SPHINXBUILD) -b spelling $( ALLSPHINXOPTS) $( BUILDDIR) /spelling
@echo
@echo "Spell check complete; look for any errors in the above output " \
" or in $( BUILDDIR) /spelling/output.txt. "
2017-05-23 17:08:34 +02:00
linkcheck : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b linkcheck $( ALLSPHINXOPTS) $( BUILDDIR) /linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
" or in $( BUILDDIR) /linkcheck/output.txt. "
2017-05-23 17:08:34 +02:00
doctest : check_sphinx -build
2011-05-23 14:51:31 +08:00
$( SPHINXBUILD) -b doctest $( ALLSPHINXOPTS) $( BUILDDIR) /doctest
@echo "Testing of doctests in the sources finished, look at the " \
" results in $( BUILDDIR) /doctest/output.txt. "
2013-10-10 21:49:40 -04:00
2019-10-28 13:15:27 +00:00
xml : check_sphinx -build
2013-10-10 21:49:40 -04:00
$( SPHINXBUILD) -b xml $( ALLSPHINXOPTS) $( BUILDDIR) /xml
@echo
@echo " Build finished. The XML files are in $( BUILDDIR) /xml. "
2019-10-28 13:15:27 +00:00
pseudoxml : check_sphinx -build
2013-10-10 21:49:40 -04:00
$( SPHINXBUILD) -b pseudoxml $( ALLSPHINXOPTS) $( BUILDDIR) /pseudoxml
@echo
@echo " Build finished. The pseudo-XML files are in $( BUILDDIR) /pseudoxml. "