summaryrefslogtreecommitdiffstats
path: root/documentation/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/Makefile')
-rw-r--r--documentation/Makefile39
1 files changed, 22 insertions, 17 deletions
diff --git a/documentation/Makefile b/documentation/Makefile
index c930d2d280..65e29713d4 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -3,17 +3,18 @@
3 3
4# You can set these variables from the command line, and also 4# You can set these variables from the command line, and also
5# from the environment for the first two. 5# from the environment for the first two.
6SPHINXOPTS ?= -W --keep-going -j auto 6SPHINXOPTS ?= -W --keep-going -j auto
7SPHINXBUILD ?= sphinx-build 7SPHINXBUILD ?= sphinx-build
8# Release notes are excluded because they contain contributor names and commit messages which can't be modified 8# Release notes are excluded because they contain contributor names and commit messages which can't be modified
9VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' 9VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst'
10VALEDOCS ?= . 10SOURCEDIR = .
11SOURCEDIR = . 11VALEDOCS ?= $(SOURCEDIR)
12IMAGEDIRS = */svg 12SPHINXLINTDOCS ?= $(SOURCEDIR)
13BUILDDIR = _build 13IMAGEDIRS = */svg
14DESTDIR = final 14BUILDDIR = _build
15SVG2PNG = inkscape 15DESTDIR = final
16SVG2PDF = inkscape 16SVG2PNG = rsvg-convert
17SVG2PDF = rsvg-convert
17 18
18ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) 19ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0)
19$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed") 20$(error "The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed")
@@ -25,10 +26,12 @@ help:
25 26
26.PHONY: all help Makefile clean stylecheck publish epub latexpdf 27.PHONY: all help Makefile clean stylecheck publish epub latexpdf
27 28
28publish: Makefile html singlehtml 29publish: Makefile epub latexpdf html singlehtml
29 rm -rf $(BUILDDIR)/$(DESTDIR)/ 30 rm -rf $(BUILDDIR)/$(DESTDIR)/
30 mkdir -p $(BUILDDIR)/$(DESTDIR)/ 31 mkdir -p $(BUILDDIR)/$(DESTDIR)/
31 cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/ 32 cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/
33 mkdir -p $(BUILDDIR)/$(DESTDIR)/_static
34 cp $(BUILDDIR)/epub/TheYoctoProject.epub $(BUILDDIR)/latex/theyoctoproject.pdf $(BUILDDIR)/$(DESTDIR)/_static/
32 cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html 35 cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html
33 sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html 36 sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
34 37
@@ -40,11 +43,11 @@ PNGs := $(foreach dir, $(IMAGEDIRS), $(patsubst %.svg,%.png,$(wildcard $(SOURCED
40 43
41# Pattern rule for converting SVG to PDF 44# Pattern rule for converting SVG to PDF
42%.pdf : %.svg 45%.pdf : %.svg
43 $(SVG2PDF) --export-filename=$@ $< 46 $(SVG2PDF) --format=Pdf --output=$@ $<
44 47
45# Pattern rule for converting SVG to PNG 48# Pattern rule for converting SVG to PNG
46%.png : %.svg 49%.png : %.svg
47 $(SVG2PNG) --export-filename=$@ $< 50 $(SVG2PNG) --format=Png --output=$@ $<
48 51
49clean: 52clean:
50 @rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js releases.rst 53 @rm -rf $(BUILDDIR) $(PNGs) $(PDFs) poky.yaml sphinx-static/switchers.js releases.rst
@@ -53,17 +56,19 @@ stylecheck:
53 vale sync 56 vale sync
54 vale $(VALEOPTS) $(VALEDOCS) 57 vale $(VALEOPTS) $(VALEDOCS)
55 58
56stylecheck: 59sphinx-lint:
57 vale sync 60 sphinx-lint $(SPHINXLINTDOCS)
58 vale $(VALEOPTS) $(VALEDOCS)
59 61
60epub: $(PNGs) 62epub: $(PNGs)
61 $(SOURCEDIR)/set_versions.py 63 $(SOURCEDIR)/set_versions.py
62 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 64 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
63 65
66# Note: we need to pass buf_size here (which is also configurable from
67# texmf.cnf), to avoid following error:
68# Unable to read an entire line---bufsize=200000. Please increase buf_size in texmf.cnf.
64latexpdf: $(PDFs) 69latexpdf: $(PDFs)
65 $(SOURCEDIR)/set_versions.py 70 $(SOURCEDIR)/set_versions.py
66 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 71 buf_size=10000000 $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
67 72
68all: html epub latexpdf 73all: html epub latexpdf
69 74