summaryrefslogtreecommitdiff
path: root/doc/Makefile
blob: 090e8c9d7601a23dcf8719bd82db0399b8e460d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = build

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source

all: docs

.PHONY: apidoc
apidoc:
	mkdir -p source/elements
	mkdir -p source/sources
	sphinx-apidoc --separate -o source $(CURDIR)/../buildstream
	sphinx-apidoc --separate -o source/elements $(CURDIR)/../buildstream/plugins/elements
	sphinx-apidoc --separate -o source/sources $(CURDIR)/../buildstream/plugins/sources

# We set PYTHONPATH here because source/conf.py sys.modules hacks dont seem to help sphinx-build import the plugins
.PHONY: docs
docs: apidoc
	PYTHONPATH=$(CURDIR)/../buildstream/plugins/sources:$(CURDIR)/../buildstream/plugins/elements \
	    $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html \
	    $(wildcard source/*.rst) \
	    $(wildcard source/elements/*.rst) \
	    $(wildcard source/sources/*.rst)
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."