From b3c187aea9c4ed3f06873072f9e888d5a6496966 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 31 Aug 2012 12:04:26 -0400 Subject: [PATCH] Check for doc build dependency before building The import error produced when the sphinxcontrib-httpdomain package is missing is for sphinxcontrib.autohttp.flask, but the package to install is sphinxcontrib-httpdomain. This check produces a more useful error message than allowing Sphinx to report the import error by itself. Change-Id: I2f53761da47b593e74d12c7dd213e69e4d71db21 Signed-off-by: Doug Hellmann --- doc/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index 0be88b168d..385a11ec1d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -41,11 +41,15 @@ help: clean: -rm -rf $(BUILDDIR)/* -html: +html: check-dependencies $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." +.PHONY: check-dependencies +check-dependencies: + @python -c 'import sphinxcontrib.autohttp.flask' >/dev/null 2>&1 || (echo "ERROR: Missing Sphinx dependencies. Run: pip install sphinxcontrib-httpdomain" && exit 1) + dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo