+# Run Sphinx to build the documentation. It expects the variable SPHINX_DIR
+# to be set to the directory where the Sphinx's conf.py and reST source files
+# are. This rule is a little restrictive, but you can always make your own if
+# it doesn't fit your needs ;)
+$D/%/sphinx-stamp: $G/sphinx-flags
+ $V mkdir -p $(@D)/$(SPHINX_FORMAT)
+ $(call exec,$(SPHINX) $(if $V,-q) -b $(SPHINX_FORMAT) \
+ -d $(@D)/doctrees -D latex_paper_size=$(SPHINX_PAPERSIZE) \
+ $(SPHINX_DIR) $(@D)/$(SPHINX_FORMAT),$(@D),$(SPHINX))
+ $V touch $@
+