Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Minimal makefile for Sphinx documentation
  2. #
  3. ifneq ($(EXAMPLES_PATTERN),)
  4. EXAMPLES_PATTERN_OPTS := -D sphinx_gallery_conf.filename_pattern="$(EXAMPLES_PATTERN)"
  5. endif
  6. # You can set these variables from the command line.
  7. SPHINXOPTS = -W -j auto $(EXAMPLES_PATTERN_OPTS)
  8. SPHINXBUILD = sphinx-build
  9. SPHINXPROJ = torchvision
  10. SOURCEDIR = source
  11. BUILDDIR = build
  12. # Put it first so that "make" without argument is like "make help".
  13. help:
  14. @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
  15. docset: html
  16. doc2dash --name $(SPHINXPROJ) --icon $(SOURCEDIR)/_static/img/pytorch-logo-flame.png --enable-js --online-redirect-url http://pytorch.org/vision/ --force $(BUILDDIR)/html/
  17. # Manually fix because Zeal doesn't deal well with `icon.png`-only at 2x resolution.
  18. cp $(SPHINXPROJ).docset/icon.png $(SPHINXPROJ).docset/icon@2x.png
  19. convert $(SPHINXPROJ).docset/icon@2x.png -resize 16x16 $(SPHINXPROJ).docset/icon.png
  20. html-noplot: # Avoids running the gallery examples, which may take time
  21. $(SPHINXBUILD) -D plot_gallery=0 -b html "${SOURCEDIR}" "$(BUILDDIR)"/html
  22. @echo
  23. @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
  24. clean:
  25. rm -rf $(BUILDDIR)/*
  26. rm -rf $(SOURCEDIR)/auto_examples/ # sphinx-gallery
  27. rm -rf $(SOURCEDIR)/gen_modules/ # sphinx-gallery
  28. rm -rf $(SOURCEDIR)/generated/ # autosummary
  29. rm -rf $(SOURCEDIR)/models/generated # autosummary
  30. .PHONY: help Makefile docset
  31. # Catch-all target: route all unknown targets to Sphinx using the new
  32. # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
  33. %: Makefile
  34. @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)