Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Makefile for Sphinx documentation
  2. SPHINXOPTS ?=
  3. SPHINXBUILD ?= sphinx-build
  4. SPHINXSOURCEDIR ?= .
  5. SPHINXBUILDDIR ?= _build
  6. SPHINXPAPER ?=
  7. FILELIST ?=
  8. # User-friendly check for sphinx-build
  9. ifneq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 0)
  10. define ERROR_MESSAGE
  11. The '$(SPHINXBUILD)' command was not found!
  12. Make sure you have Sphinx installed, then set the SPHINXBUILD make variable to the full path of the '$(SPHINXBUILD)' executable.
  13. Alternatively you can add the executable's directory to your PATH.
  14. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/
  15. endef
  16. $(error ${ERROR_MESSAGE})
  17. endif
  18. PAPEROPT_a4 = -D latex_paper_size=a4
  19. PAPEROPT_letter = -D latex_paper_size=letter
  20. COMMONSPHINXOPTS = $(PAPEROPT_$(SPHINXPAPER)) $(SPHINXOPTS) '$(SPHINXSOURCEDIR)'
  21. DEFAULTSPHINXOPTS = -d $(SPHINXBUILDDIR)/doctrees $(COMMONSPHINXOPTS)
  22. .PHONY: help clean
  23. help:
  24. @$(SPHINXBUILD) -M help $(DEFAULTSPHINXOPTS) $(O) "$(SPHINXBUILDDIR)"
  25. # This is used by https://github.com/godotengine/godot-docs-l10n
  26. # See https://github.com/godotengine/godot-docs-l10n/blob/f157c0cacc8a6e542e06e96b983b27de91637f8b/update.sh#L92
  27. gettext:
  28. $(SPHINXBUILD) -b gettext -t i18n $(COMMONSPHINXOPTS) ../sphinx/templates $(FILELIST)
  29. %:
  30. $(SPHINXBUILD) -M $@ $(DEFAULTSPHINXOPTS) $(O) "$(SPHINXBUILDDIR)"/$@ $(FILELIST)