1
0

Makefile 7.9 KB

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