Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. DESTDIR = final
  10. ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
  11. $(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
  12. endif
  13. # Put it first so that "make" without argument is like "make help".
  14. help:
  15. @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
  16. .PHONY: help Makefile clean publish
  17. publish: Makefile html singlehtml
  18. rm -rf $(BUILDDIR)/$(DESTDIR)/
  19. mkdir -p $(BUILDDIR)/$(DESTDIR)/
  20. cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/
  21. cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html
  22. sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
  23. clean:
  24. @rm -rf $(BUILDDIR)
  25. # Catch-all target: route all unknown targets to Sphinx using the new
  26. # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
  27. %: Makefile
  28. @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)