summaryrefslogtreecommitdiff
path: root/doc/Makefile
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-06-13 23:12:53 -0400
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-06-13 23:12:53 -0400
commit6da05577407545bf6511054d8a822cebc38824b9 (patch)
tree5ef751e40cc963687a0efb8bafdefc441e62c58a /doc/Makefile
parentfa73abe4c13a081eed45ae9a4eb6fa2864a73e3c (diff)
downloadbuildstream-6da05577407545bf6511054d8a822cebc38824b9.tar.gz
doc: Improve the new console output html generator
Before we were creating one description file for each output, making it easier to declare a make rule for it - but the result was that we would have to build things more and it takes a long time. Instead, now we have session files which describe a series of commands to run in a session, and each command optionally produces an output file.
Diffstat (limited to 'doc/Makefile')
-rw-r--r--doc/Makefile26
1 files changed, 12 insertions, 14 deletions
diff --git a/doc/Makefile b/doc/Makefile
index dbb293449..1c1e538ab 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -26,7 +26,7 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
BST2HTML = $(CURDIR)/bst2html.py
-.PHONY: all clean templates templates-clean html devhelp
+.PHONY: all clean templates templates-clean sessions sessions-clean html devhelp
# Canned recipe for generating plugin api skeletons
# $1 = the plugin directory
@@ -59,11 +59,10 @@ define plugin-doc-skeleton
endef
-
# We set PYTHONPATH here because source/conf.py sys.modules hacks dont seem to help sphinx-build import the plugins
all: html devhelp
-clean: templates-clean
+clean: templates-clean sessions-clean
rm -rf build
# Generate rst templates for the docs using a mix of sphinx-apidoc and
@@ -75,23 +74,26 @@ templates:
$(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/elements,elements)
$(call plugin-doc-skeleton,$(CURDIR)/../buildstream/plugins/sources,sources)
+templates-clean:
+ rm -rf source/elements
+ rm -rf source/sources
+
# Generate the html fragments of colorized BuildStream terminal output only
# if they don't yet exist. This is expensive so you need to run `make clean` first
# if you want to regenerate them.
#
-SESSION_HTML = $(patsubst sessions/%.run,source/sessions/%.html,$(wildcard sessions/*.run))
-source/sessions/%.html:
- $(BST2HTML) -o $@ --description $(patsubst source/sessions/%.html,sessions/%.run,$@)
+sessions:
+ for file in "$(wildcard sessions/*.run)"; do \
+ $(BST2HTML) --description $$file; \
+ done
-templates-clean:
- rm -rf source/elements
- rm -rf source/sources
+sessions-clean:
rm -rf source/sessions
# Targets which generate docs with sphinx build
#
#
-html devhelp: templates $(SESSION_HTML)
+html devhelp: templates
@echo "Building $@..."
PYTHONPATH=$(CURDIR)/../buildstream/plugins \
$(SPHINXBUILD) -b $@ $(ALLSPHINXOPTS) "$(BUILDDIR)/$@" \
@@ -101,7 +103,3 @@ html devhelp: templates $(SESSION_HTML)
$(wildcard source/sources/*.rst)
@echo
@echo "Build of $@ finished, output: $(CURDIR)/$(BUILDDIR)/$@"
-
-testy:
- @echo "Using $(SPHINXBUILD)"
- @echo "Py is $(PYV)"