Makefile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Makefile for Sphinx documentation
  2. #
  3. MODULE_TOPDIR=../../../..
  4. include $(MODULE_TOPDIR)/include/Make/Vars.make
  5. include $(MODULE_TOPDIR)/include/Make/Rules.make
  6. # You can set these variables from the command line.
  7. SPHINXOPTS =
  8. ifneq (@(type sphinx-build2 > /dev/null),)
  9. SPHINXBUILD = sphinx-build2
  10. endif
  11. ifneq (@(type sphinx-build > /dev/null),)
  12. SPHINXBUILD = sphinx-build
  13. endif
  14. PAPER =
  15. BUILDDIR = _build
  16. BUILDDIR_HTML = $(HTMLDIR)/pygrass
  17. MYGISBASE = $(GISBASE)
  18. # Internal variables.
  19. PAPEROPT_a4 = -D latex_paper_size=a4
  20. PAPEROPT_letter = -D latex_paper_size=letter
  21. ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  22. # the i18n builder cannot share the environment and doctrees with the others
  23. I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  24. .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
  25. .DEFAULT_GOAL := help
  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 " epub to make an epub"
  32. @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
  33. @echo " latexpdf to make LaTeX files and run them through pdflatex"
  34. @echo " man to make manual pages"
  35. @echo " doctest to run all doctests embedded in the documentation (if enabled)"
  36. clean:
  37. -rm -rf $(BUILDDIR)/*
  38. html:
  39. $(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  40. @echo
  41. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  42. dirhtml:
  43. $(call run_grass,$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  44. @echo
  45. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  46. singlehtml:
  47. $(call run_grass,$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  48. @echo
  49. @echo "Build finished. The HTML page is in $(BUILDDIR_HTML)"
  50. epub:
  51. $(call run_grass,$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub)
  52. @echo
  53. @echo "Build finished. The epub file is in $(BUILDDIR)/epub/"
  54. latex:
  55. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  56. @echo
  57. @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
  58. @echo "Run \`make' in that directory to run these through (pdf)latex" \
  59. "(use \`make latexpdf' here to do that automatically)."
  60. latexpdf:
  61. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  62. @echo "Running LaTeX files through pdflatex..."
  63. $(MAKE) -C $(BUILDDIR)/latex all-pdf
  64. @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
  65. man:
  66. $(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man)
  67. @echo
  68. @echo "Build finished. The manual pages are in $(BUILDDIR)/man/"
  69. doctest:
  70. $(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)
  71. @echo "Testing of doctests in the sources finished, look at the " \
  72. "results in $(BUILDDIR)/doctest/output.txt."