summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2020-04-20 21:42:15 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2020-04-20 15:36:59 +0000
commit6160ab81256faf854c633413a28c4893fe6a3902 (patch)
treea64f01cb437fb84798c5501a5b64f8809aad285b
parente30c18f820bb59d174f2424b7723f2f100a40cba (diff)
downloadbuildstream-tristan/fix-doc-builds.tar.gz
doc/Makefile: Ensure we error out if bst2html.py fails.tristan/fix-doc-builds
The way we were using $(foreach ...) here from GNU Make was causing errors to be ignored, this should really only be used for collecting target names and such. In this commit, we instead: * Collect the SESSION_FILES using $(wildcard ...) * Use a "%.run:" Rule to run bst2html.py for each session file separately, ensuring that we bail out the build if the session generation fails. * Having the SESSION_FILES depend on the phony target sessions-prep, ensures that this rule will be called unconditionally, regardless of the existance of the .run files.
-rw-r--r--doc/Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/Makefile b/doc/Makefile
index 4a9373d34..43b0cd054 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -106,13 +106,20 @@ sessions-prep:
mkdir -p source/sessions
cp source/sessions-stored/*.html source/sessions
+# bst2html is called unconditionally for every session file in SESSION_FILES.
+#
# By default, this will generate the html fragments of colorized BuildStream terminal
-# output only if they don't yet exist.
+# output only if the output html files don't yet exist.
#
# Specify BST_FORCE_SESSION_REBUILD=1 to force rebuild all session html files.
#
-sessions: sessions-prep
- $(foreach file,$(wildcard sessions/*.run),PYTHONPATH=$(PYTHONPATH) $(BST2HTML) $(BST2HTMLOPTS) $(file) ; )
+SESSION_FILES=$(wildcard sessions/*.run)
+$(SESSION_FILES): sessions-prep
+
+%.run:
+ PYTHONPATH=$(PYTHONPATH) $(BST2HTML) $(BST2HTMLOPTS) $@
+
+sessions: $(SESSION_FILES)
sessions-clean:
rm -rf source/sessions