Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. PAPER =
  9. BUILDDIR = _build
  10. BUILDDIR_HTML = $(HTMLDIR)/wxgui
  11. MYGISBASE = $(GISBASE)
  12. # Internal variables.
  13. PAPEROPT_a4 = -D latex_paper_size=a4
  14. PAPEROPT_letter = -D latex_paper_size=letter
  15. ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  16. # the i18n builder cannot share the environment and doctrees with the others
  17. I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
  18. .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
  19. .DEFAULT_GOAL := help
  20. ifneq (@(type sphinx-apidoc2 > /dev/null),)
  21. SPHINXAPIDOC = sphinx-apidoc2
  22. endif
  23. ifneq (@(type sphinx-apidoc > /dev/null),)
  24. SPHINXAPIDOC = sphinx-apidoc
  25. endif
  26. ifneq (@(type sphinx-build2 > /dev/null),)
  27. SPHINXBUILD = sphinx-build2
  28. endif
  29. ifneq (@(type sphinx-build > /dev/null),)
  30. SPHINXBUILD = sphinx-build
  31. endif
  32. wxguihelp:
  33. @echo "Please use \`make <target>' where <target> is one of"
  34. @echo " html to make standalone HTML files"
  35. @echo " dirhtml to make HTML files named index.html in directories"
  36. @echo " singlehtml to make a single large HTML file"
  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 " man to make manual pages"
  41. @echo " doctest to run all doctests embedded in the documentation (if enabled)"
  42. wxguiclean:
  43. -rm -rf $(BUILDDIR)/*
  44. -rm -f _templates/layout.html
  45. wxguiapidoc:
  46. $(call run_grass, $(SPHINXAPIDOC) -T -f -o . ../../)
  47. wxguihtml:
  48. $(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  49. @echo
  50. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  51. wxguidirhtml:
  52. $(call run_grass,$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  53. @echo
  54. @echo "Build finished. The HTML pages are in $(BUILDDIR_HTML)"
  55. wxguisinglehtml:
  56. $(call run_grass,$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR_HTML))
  57. @echo
  58. @echo "Build finished. The HTML page is in $(BUILDDIR_HTML)"
  59. wxguiepub:
  60. $(call run_grass,$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub)
  61. @echo
  62. @echo "Build finished. The epub file is in $(BUILDDIR)/epub/"
  63. wxguilatex:
  64. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  65. @echo
  66. @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
  67. @echo "Run \`make' in that directory to run these through (pdf)latex" \
  68. "(use \`make latexpdf' here to do that automatically)."
  69. wxguilatexpdf:
  70. $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex)
  71. @echo "Running LaTeX files through pdflatex..."
  72. $(MAKE) -C $(BUILDDIR)/latex all-pdf
  73. @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex/"
  74. wxguiman:
  75. $(call run_grass,$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(MANDIR))
  76. @echo
  77. @echo "Build finished. The manual pages are in $(MANDIR)/"
  78. wxguidoctest:
  79. $(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest)
  80. @echo "Testing of doctests in the sources finished, look at the " \
  81. "results in $(BUILDDIR)/doctest/output.txt."