Commit 85bd9020 authored by Ben Hutchings's avatar Ben Hutchings Committed by Jonathan Corbet

doc-rst: Break shell command sequences on failure

As $(SHELL) doesn't include the -e option, any loop or other sequence
needs to include explicit checks for failing commands.

Fixes: 609afe6b ("Documentation/sphinx: build the media intermediate ...")
Fixes: 606b9ac8 ("doc-rst: generic way to build only sphinx sub-folders")
Fixes: cd21379b ("doc-rst: generic way to build PDF of sub-folders")
Tested-by: default avatarMarkus Heiser <markus.heiser@darmarit.de>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 028f2533
...@@ -43,7 +43,7 @@ ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ...@@ -43,7 +43,7 @@ ALLSPHINXOPTS = $(KERNELDOC_CONF) $(PAPEROPT_$(PAPER)) $(SPHINXOPTS)
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# commands; the 'cmd' from scripts/Kbuild.include is not *loopable* # commands; the 'cmd' from scripts/Kbuild.include is not *loopable*
loop_cmd = $(echo-cmd) $(cmd_$(1)) loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
# $2 sphinx builder e.g. "html" # $2 sphinx builder e.g. "html"
# $3 name of the build subfolder / e.g. "media", used as: # $3 name of the build subfolder / e.g. "media", used as:
...@@ -54,7 +54,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) ...@@ -54,7 +54,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
# e.g. "media" for the linux-tv book-set at ./Documentation/media # e.g. "media" for the linux-tv book-set at ./Documentation/media
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\ cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2 && \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
$(SPHINXBUILD) \ $(SPHINXBUILD) \
-b $2 \ -b $2 \
...@@ -63,7 +63,7 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) ...@@ -63,7 +63,7 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
-D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) \ -D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) \
$(ALLSPHINXOPTS) \ $(ALLSPHINXOPTS) \
$(abspath $(srctree)/$(src)/$5) \ $(abspath $(srctree)/$(src)/$5) \
$(abspath $(BUILDDIR)/$3/$4); $(abspath $(BUILDDIR)/$3/$4)
htmldocs: htmldocs:
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var))) @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
...@@ -80,7 +80,7 @@ pdfdocs: ...@@ -80,7 +80,7 @@ pdfdocs:
else # HAVE_PDFLATEX else # HAVE_PDFLATEX
pdfdocs: latexdocs pdfdocs: latexdocs
$(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex;) $(foreach var,$(SPHINXDIRS), $(MAKE) PDFLATEX=$(PDFLATEX) LATEXOPTS="$(LATEXOPTS)" -C $(BUILDDIR)/$(var)/latex || exit;)
endif # HAVE_PDFLATEX endif # HAVE_PDFLATEX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment