Skip to content

Commit

Permalink
build: Only re-gen HTML docs when needed.
Browse files Browse the repository at this point in the history
When sphinx-build is installed, the docs were being re-generated during
every invocation of "make".  This patch sets up dependencies such that
sphinx-build will only be executed if one of the documentation files has
changed.

Signed-off-by: Russell Bryant <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
russellb committed Mar 20, 2017
1 parent 6134ea0 commit e9f521b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
/distfiles
/dist-docs
/flake8-check
/htmldocs-check
/install-sh
/libtool
/manpage-check
Expand Down
12 changes: 7 additions & 5 deletions Documentation/automake.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
EXTRA_DIST += \
DOC_SOURCE = \
Documentation/group-selection-method-property.txt \
Documentation/_static/logo.png \
Documentation/_static/overview.png \
Expand Down Expand Up @@ -90,6 +90,8 @@ EXTRA_DIST += \
Documentation/internals/contributing/submitting-patches.rst \
Documentation/requirements.txt

EXTRA_DIST += $(DOC_SOURCE)

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
Expand All @@ -106,9 +108,10 @@ sphinx_verbose_ = $(sphinx_verbose_@AM_DEFAULT_V@)
sphinx_verbose_0 = -q

if HAVE_SPHINX
htmldocs:
$(AM_V_GEN)$(SPHINXBUILD) $(sphinx_verbose) -b html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html
ALL_LOCAL += htmldocs
htmldocs-check: $(DOC_SOURCE)
$(AM_V_GEN)$(SPHINXBUILD) $(sphinx_verbose) -b html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html && touch $@
ALL_LOCAL += htmldocs-check
CLEANFILES += htmldocs-check

check-docs:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/linkcheck
Expand All @@ -119,6 +122,5 @@ clean-docs:
rm -rf $(SPHINXBUILDDIR)/linkcheck
CLEAN_LOCAL += clean-docs
endif
.PHONY: htmldocs
.PHONY: check-docs
.PHONY: clean-docs

0 comments on commit e9f521b

Please sign in to comment.