diff options
Diffstat (limited to 'documentation/Makefile')
-rw-r--r-- | documentation/Makefile | 39 |
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. |
6 | SPHINXOPTS ?= -W --keep-going -j auto | 6 | SPHINXOPTS ?= -W --keep-going -j auto |
7 | SPHINXBUILD ?= sphinx-build | 7 | SPHINXBUILD ?= 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 |
9 | VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' | 9 | VALEOPTS ?= --no-wrap --glob '!migration-guides/release-notes-*.rst' |
10 | VALEDOCS ?= . | 10 | SOURCEDIR = . |
11 | SOURCEDIR = . | 11 | VALEDOCS ?= $(SOURCEDIR) |
12 | IMAGEDIRS = */svg | 12 | SPHINXLINTDOCS ?= $(SOURCEDIR) |
13 | BUILDDIR = _build | 13 | IMAGEDIRS = */svg |
14 | DESTDIR = final | 14 | BUILDDIR = _build |
15 | SVG2PNG = inkscape | 15 | DESTDIR = final |
16 | SVG2PDF = inkscape | 16 | SVG2PNG = rsvg-convert |
17 | SVG2PDF = rsvg-convert | ||
17 | 18 | ||
18 | ifeq ($(shell if which $(SPHINXBUILD) >/dev/null 2>&1; then echo 1; else echo 0; fi),0) | 19 | ifeq ($(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 | ||
28 | publish: Makefile html singlehtml | 29 | publish: 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 | ||
49 | clean: | 52 | clean: |
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 | ||
56 | stylecheck: | 59 | sphinx-lint: |
57 | vale sync | 60 | sphinx-lint $(SPHINXLINTDOCS) |
58 | vale $(VALEOPTS) $(VALEDOCS) | ||
59 | 61 | ||
60 | epub: $(PNGs) | 62 | epub: $(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. | ||
64 | latexpdf: $(PDFs) | 69 | latexpdf: $(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 | ||
68 | all: html epub latexpdf | 73 | all: html epub latexpdf |
69 | 74 | ||