Makefile 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. # Makefile for Sphinx documentation
  2. #
  3. # You can set these variables from the command line.
  4. # Allow linkcheck to run without treating warnings as errors; -W will
  5. # fast-fail if enabled; it's better to gather the whole list of bad links at once.
  6. SPHINXOPTS = -a -E -W -j auto
  7. LOCALSPHINXOPTS = -W -j auto
  8. LINKCHECKOPTS = -a -E -j auto
  9. SPHINXBUILD = sphinx-build
  10. SPHINXAUTOBUILD = sphinx-autobuild --port 0 --open-browser --ignore "*.log" --ignore "*data/examples*" --ignore "*train/examples*" --ignore "*serve/examples*"
  11. PAPER =
  12. BUILDDIR = _build
  13. # User-friendly check for sphinx-build
  14. ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
  15. $(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/)
  16. endif
  17. # Internal variables.
  18. PAPEROPT_a4 = -D latex_paper_size=a4
  19. PAPEROPT_letter = -D latex_paper_size=letter
  20. ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
  21. ALLLOCALSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(LOCALSPHINXOPTS) source
  22. ALLLINKCHECKOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(LINKCHECKOPTS) source
  23. # the i18n builder cannot share the environment and doctrees with the others
  24. I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
  25. .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext show
  26. help:
  27. @echo "Please use \`make <target>' where <target> is one of"
  28. @echo " html to make standalone HTML files"
  29. @echo " dirhtml to make HTML files named index.html in directories"
  30. @echo " singlehtml to make a single large HTML file"
  31. @echo " pickle to make pickle files"
  32. @echo " json to make JSON files"
  33. @echo " htmlhelp to make HTML files and a HTML help project"
  34. @echo " qthelp to make HTML files and a qthelp project"
  35. @echo " applehelp to make an Apple Help Book"
  36. @echo " devhelp to make HTML files and a Devhelp project"
  37. @echo " epub to make an epub"
  38. @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
  39. @echo " latexpdf to make LaTeX files and run them through pdflatex"
  40. @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
  41. @echo " text to make text files"
  42. @echo " man to make manual pages"
  43. @echo " texinfo to make Texinfo files"
  44. @echo " info to make Texinfo files and run them through makeinfo"
  45. @echo " gettext to make PO message catalogs"
  46. @echo " changes to make an overview of all changed/added/deprecated items"
  47. @echo " xml to make Docutils-native XML files"
  48. @echo " pseudoxml to make pseudoxml-XML files for display purposes"
  49. @echo " linkcheck to check all external links for integrity"
  50. @echo " linkcheck_all to check all external links for integrity"
  51. @echo " doctest to run all doctests embedded in the documentation (if enabled)"
  52. @echo " coverage to run coverage check of the documentation (if enabled)"
  53. clean:
  54. rm -rf $(BUILDDIR)/*
  55. rm -rf ./source/__pycache__/
  56. rm -rf ./source/_ext/__pycache__/
  57. rm -rf ./source/*/api/doc/*
  58. rm -rf ./source/ray-references/api/*/doc/*
  59. rm -rf ./source/cluster/running_applications/doc/*
  60. rm -rf ./source/cluster/running_applications/job-submission/doc/*
  61. rm -rf ./source/ray-observability/api/state/doc*
  62. rm -rf ./source/rllib/package_ref/doc*
  63. rm -rf ./source/ray-more-libs/doc/*
  64. rm -rf ./source/ray-observability/reference/doc/*
  65. rm -f ./source/data/examples.rst
  66. rm -f ./source/serve/examples.rst
  67. rm -f ./source/train/examples.rst
  68. html:
  69. $(SPHINXBUILD) -W --keep-going -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
  70. @echo
  71. @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
  72. @echo "View the documentation by opening a browser and going to $(BUILDDIR)/html/index.html."
  73. develop: html
  74. RAY_DIR := $(shell pwd | rev | cut -d'/' -f2- | rev)
  75. local:
  76. python load_doc_cache.py --ray-dir=$(RAY_DIR)
  77. python update_cache_env.py --ray-dir=$(RAY_DIR)
  78. $(SPHINXAUTOBUILD) -W --keep-going -b html $(ALLLOCALSPHINXOPTS) $(BUILDDIR)/html
  79. dirhtml:
  80. $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
  81. @echo
  82. @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
  83. singlehtml:
  84. $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
  85. @echo
  86. @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
  87. pickle:
  88. $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
  89. @echo
  90. @echo "Build finished; now you can process the pickle files."
  91. json:
  92. $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
  93. @echo
  94. @echo "Build finished; now you can process the JSON files."
  95. htmlhelp:
  96. $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
  97. @echo
  98. @echo "Build finished; now you can run HTML Help Workshop with the" \
  99. ".hhp project file in $(BUILDDIR)/htmlhelp."
  100. qthelp:
  101. $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
  102. @echo
  103. @echo "Build finished; now you can run "qcollectiongenerator" with the" \
  104. ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
  105. @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Ray.qhcp"
  106. @echo "To view the help file:"
  107. @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Ray.qhc"
  108. applehelp:
  109. $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
  110. @echo
  111. @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
  112. @echo "N.B. You won't be able to view it unless you put it in" \
  113. "~/Library/Documentation/Help or install it in your application" \
  114. "bundle."
  115. devhelp:
  116. $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
  117. @echo
  118. @echo "Build finished."
  119. @echo "To view the help file:"
  120. @echo "# mkdir -p $$HOME/.local/share/devhelp/Ray"
  121. @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Ray"
  122. @echo "# devhelp"
  123. epub:
  124. $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
  125. @echo
  126. @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
  127. latex:
  128. $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
  129. @echo
  130. @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
  131. @echo "Run \`make' in that directory to run these through (pdf)latex" \
  132. "(use \`make latexpdf' here to do that automatically)."
  133. latexpdf:
  134. $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
  135. @echo "Running LaTeX files through pdflatex..."
  136. $(MAKE) -C $(BUILDDIR)/latex all-pdf
  137. @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
  138. latexpdfja:
  139. $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
  140. @echo "Running LaTeX files through platex and dvipdfmx..."
  141. $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
  142. @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
  143. text:
  144. $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
  145. @echo
  146. @echo "Build finished. The text files are in $(BUILDDIR)/text."
  147. man:
  148. $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
  149. @echo
  150. @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
  151. texinfo:
  152. $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
  153. @echo
  154. @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
  155. @echo "Run \`make' in that directory to run these through makeinfo" \
  156. "(use \`make info' here to do that automatically)."
  157. info:
  158. $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
  159. @echo "Running Texinfo files through makeinfo..."
  160. make -C $(BUILDDIR)/texinfo info
  161. @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
  162. gettext:
  163. $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
  164. @echo
  165. @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
  166. changes:
  167. $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
  168. @echo
  169. @echo "The overview file is in $(BUILDDIR)/changes."
  170. linkcheck:
  171. $(SPHINXBUILD) -b linkcheck $(ALLLINKCHECKOPTS) $(BUILDDIR)/linkcheck
  172. @echo
  173. @echo "Link check complete; look for any errors in the above output " \
  174. "or in $(BUILDDIR)/linkcheck/output.txt."
  175. linkcheck_all:
  176. LINKCHECK_ALL=1 $(SPHINXBUILD) -b linkcheck $(ALLLINKCHECKOPTS) $(BUILDDIR)/linkcheck
  177. @echo
  178. @echo "Link check complete; look for any errors in the above output " \
  179. "or in $(BUILDDIR)/linkcheck/output.txt."
  180. doctest:
  181. $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
  182. @echo "Testing of doctests in the sources finished, look at the " \
  183. "results in $(BUILDDIR)/doctest/output.txt."
  184. coverage:
  185. $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
  186. @echo "Testing of coverage in the sources finished, look at the " \
  187. "results in $(BUILDDIR)/coverage/python.txt."
  188. xml:
  189. $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
  190. @echo
  191. @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
  192. pseudoxml:
  193. $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
  194. @echo
  195. @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
  196. show:
  197. python -m http.server -d _build/html/