1 # Makefile for Sphinx documentation 2 # 3 4 # You can set these variables from the command line. 5 SPHINXOPTS = -W 6 SPHINXBUILD = sphinx-build 7 BUILDDIR = _build 8 CHROMESITE_BUILDDIR = $(realpath ../../doc_generated) 9 10 # User-friendly check for sphinx-build 11 ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) 12 $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) 13 endif 14 15 # Internal variables. 16 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) . 17 18 .PHONY: all help clean linkcheck doctest chromesite chromesite_rst serve 19 20 all: chromesite 21 22 help: 23 @echo "Please use \`make <target>' where <target> is one of" 24 @echo " html to make standalone HTML files" 25 @echo " chromesite build docs for developer.chrome.com" 26 @echo " chromesite_rst only build .rst docs; no doxygen" 27 @echo " serve start python web server for chromesite docs" 28 @echo " linkcheck to check all external links for integrity" 29 @echo " doctest to run all doctests embedded in the documentation (if enabled)" 30 @echo " presubmit build docs in a temp directory (for presubmit check)" 31 32 clean: 33 rm -rf $(BUILDDIR)/* 34 35 html: 36 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 37 @echo 38 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 39 40 linkcheck: 41 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 42 @echo 43 @echo "Link check complete; look for any errors in the above output " \ 44 "or in $(BUILDDIR)/linkcheck/output.txt." 45 46 doctest: 47 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 48 @echo "Testing of doctests in the sources finished, look at the " \ 49 "results in $(BUILDDIR)/doctest/output.txt." 50 51 chromesite: 52 -rm $(CHROMESITE_BUILDDIR)/.buildinfo 53 doxygen/generate_docs.py $(CHROMESITE_BUILDDIR) 54 $(SPHINXBUILD) -b chromesite $(ALLSPHINXOPTS) $(CHROMESITE_BUILDDIR) 55 rm -rf $(CHROMESITE_BUILDDIR)/images 56 cp -r $(CHROMESITE_BUILDDIR)/_images $(CHROMESITE_BUILDDIR)/images 57 rm -rf $(CHROMESITE_BUILDDIR)/{_images,searchindex.js} 58 @echo 59 @echo "Build finished. The HTML pages are in $(CHROMESITE_BUILDDIR)" 60 61 chromesite_rst: 62 -rm $(CHROMESITE_BUILDDIR)/.buildinfo 63 $(SPHINXBUILD) -b chromesite $(ALLSPHINXOPTS) $(CHROMESITE_BUILDDIR) 64 rm -rf $(CHROMESITE_BUILDDIR)/images 65 cp -r $(CHROMESITE_BUILDDIR)/_images $(CHROMESITE_BUILDDIR)/images 66 rm -rf $(CHROMESITE_BUILDDIR)/{_images,searchindex.js} 67 68 presubmit: 69 -rm $(BUILDDIR)/.buildinfo 70 $(SPHINXBUILD) -b chromesite $(ALLSPHINXOPTS) $(BUILDDIR) 71 72 serve: 73 ../../../chrome/common/extensions/docs/server2/preview.py 74