Makefile 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. -rm -f _templates/layout.html
  39. html:
  40. $(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  41. @echo
  42. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  43. dirhtml:
  44. $(call run_grass,$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  45. @echo
  46. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  47. singlehtml:
  48. $(call run_grass,$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  49. @echo
  50. @echo "Build finished. The HTML page is in $(BUILDDIR_HTML)"
  51. epub:
  52. $(call run_grass,$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub)
  53. @echo
  54. @echo "Build finished. The epub file is in $(BUILDDIR)/epub/"
  55. latex:
  56. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  57. @echo
  58. @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
  59. @echo "Run \`make' in that directory to run these through (pdf)latex" \
  60. "(use \`make latexpdf' here to do that automatically)."
  61. latexpdf:
  62. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  63. @echo "Running LaTeX files through pdflatex..."
  64. $(MAKE) -C $(BUILDDIR)/latex all-pdf
  65. @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
  66. man:
  67. $(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(MANDIR))
  68. @echo
  69. @echo "Build finished. The manual pages are in $(MANDIR)/"
  70. doctest:
  71. $(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)
  72. @echo "Testing of doctests in the sources finished, look at the " \
  73. "results in $(BUILDDIR)/doctest/output.txt."