summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-09-08 16:01:16 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-17 10:09:34 +0100
commit5f5afa2b9612a149e5e4034ea3ee4f7dadbd138b (patch)
tree0c776b0fad04aff7c7433eee86d15bc42ada5966 /documentation
parent2375dda42b529743db3f6c0dd5a6e63e68ef1fb2 (diff)
downloadpoky-5f5afa2b9612a149e5e4034ea3ee4f7dadbd138b.tar.gz
sphinx: Makefile.sphinx improvements
* add 'clean' target * use DESTDIR to set the final folder when publishing. e.g. make -f Makefile.sphinx publish DESTDIR=yp-docs (From yocto-docs rev: 35c0076bf668a81391ee99316241d180528123fc) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/Makefile.sphinx16
1 files changed, 10 insertions, 6 deletions
diff --git a/documentation/Makefile.sphinx b/documentation/Makefile.sphinx
index 396998da03..c663c29540 100644
--- a/documentation/Makefile.sphinx
+++ b/documentation/Makefile.sphinx
@@ -7,19 +7,23 @@ SPHINXOPTS ?=
7SPHINXBUILD ?= sphinx-build 7SPHINXBUILD ?= sphinx-build
8SOURCEDIR = . 8SOURCEDIR = .
9BUILDDIR = _build 9BUILDDIR = _build
10DESTDIR = final
10 11
11# Put it first so that "make" without argument is like "make help". 12# Put it first so that "make" without argument is like "make help".
12help: 13help:
13 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 15
15.PHONY: help Makefile.sphinx publish 16.PHONY: help Makefile.sphinx clean publish
16 17
17publish: Makefile.sphinx html singlehtml 18publish: Makefile.sphinx html singlehtml
18 rm -rf $(BUILDDIR)/final/ 19 rm -rf $(BUILDDIR)/$(DESTDIR)/
19 mkdir -p $(BUILDDIR)/final/ 20 mkdir -p $(BUILDDIR)/$(DESTDIR)/
20 cp -r $(BUILDDIR)/html/* $(BUILDDIR)/final/ 21 cp -r $(BUILDDIR)/html/* $(BUILDDIR)/$(DESTDIR)/
21 cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/final/singleindex.html 22 cp $(BUILDDIR)/singlehtml/index.html $(BUILDDIR)/$(DESTDIR)/singleindex.html
22 sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/final/singleindex.html 23 sed -i -e 's@index.html#@singleindex.html#@g' $(BUILDDIR)/$(DESTDIR)/singleindex.html
24
25clean:
26 @rm -rf $(BUILDDIR)
23 27
24# Catch-all target: route all unknown targets to Sphinx using the new 28# Catch-all target: route all unknown targets to Sphinx using the new
25# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 29# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).