Makefile.sphinx 954 B

123456789101112131415161718192021222324252627
  1. # Minimal makefile for Sphinx documentation
  2. #
  3. # You can set these variables from the command line, and also
  4. # from the environment for the first two.
  5. SPHINXOPTS ?=
  6. SPHINXBUILD ?= sphinx-build
  7. SOURCEDIR = .
  8. BUILDDIR = _build
  9. # Put it first so that "make" without argument is like "make help".
  10. help:
  11. @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
  12. .PHONY: help Makefile.sphinx publish
  13. publish: Makefile.sphinx html singlehtml
  14. rm -rf $(BUILDDIR)/final/
  15. mkdir -p $(BUILDDIR)/final/
  16. cp -r $(BUILDDIR)/html/* $(BUILDDIR)/final/
  17. cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/final/singleindex.html
  18. sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/final/singleindex.html
  19. # Catch-all target: route all unknown targets to Sphinx using the new
  20. # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
  21. %: Makefile.sphinx
  22. @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)