[fix] buildprocess of the docs by adding sphinx-doc-prebuilds target

The sphinx-doc-prebuilds is the single point of definition for prerequisites
each doc build needs

BTW: remove $(LXC_ENV_FOLDER) offset from BOOKS_FOLDER and DOCS_FOLDER path.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2020-06-18 18:44:22 +02:00
parent 4f7a6c09dd
commit 15924bcb67
2 changed files with 17 additions and 12 deletions

View File

@ -77,19 +77,22 @@ run: buildenv pyenvinstall
# docs # docs
# ---- # ----
sphinx-doc-prebuilds:: buildenv pyenvinstall prebuild-includes
PHONY += docs PHONY += docs
docs: buildenv pyenvinstall sphinx-doc prebuild-includes docs: sphinx-doc-prebuilds sphinx-doc
$(call cmd,sphinx,html,docs,docs) $(call cmd,sphinx,html,docs,docs)
PHONY += docs-live prebuild-includes PHONY += docs-live
docs-live: buildenv pyenvinstall sphinx-live prebuild-includes docs-live: sphinx-doc-prebuilds sphinx-live
$(call cmd,sphinx_autobuild,html,docs,docs) $(call cmd,sphinx_autobuild,html,docs,docs)
PHONY += prebuild-includes
prebuild-includes: prebuild-includes:
@mkdir -p $(DOCS_BUILD)/includes $(Q)mkdir -p $(DOCS_BUILD)/includes
@./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst $(Q)./utils/searx.sh doc | cat > $(DOCS_BUILD)/includes/searx.rst
@./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst $(Q)./utils/filtron.sh doc | cat > $(DOCS_BUILD)/includes/filtron.rst
@./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst $(Q)./utils/morty.sh doc | cat > $(DOCS_BUILD)/includes/morty.rst
$(GH_PAGES):: $(GH_PAGES)::

View File

@ -7,12 +7,12 @@ SPHINXOPTS ?=
SPHINXBUILD ?= $(PY_ENV_BIN)/sphinx-build SPHINXBUILD ?= $(PY_ENV_BIN)/sphinx-build
SPHINX_CONF ?= conf.py SPHINX_CONF ?= conf.py
DOCS_FOLDER = ./$(LXC_ENV_FOLDER)docs DOCS_FOLDER = ./docs
DOCS_BUILD = ./$(LXC_ENV_FOLDER)build/docs DOCS_BUILD = ./$(LXC_ENV_FOLDER)build/docs
DOCS_DIST = ./$(LXC_ENV_FOLDER)dist/docs DOCS_DIST = ./$(LXC_ENV_FOLDER)dist/docs
GH_PAGES ?= gh-pages GH_PAGES ?= gh-pages
BOOKS_FOLDER = ./$(LXC_ENV_FOLDER)docs BOOKS_FOLDER = ./docs
BOOKS_DIST = ./$(LXC_ENV_FOLDER)dist/books BOOKS_DIST = ./$(LXC_ENV_FOLDER)dist/books
ifeq ($(KBUILD_VERBOSE),1) ifeq ($(KBUILD_VERBOSE),1)
@ -56,11 +56,13 @@ docs-help:
# requirements # requirements
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
sphinx-doc: $(PY_ENV) sphinx-doc-prebuilds:: $(PY_ENV)
sphinx-doc: sphinx-doc-prebuilds
@echo "PYENV installing Sphinx$(SPHINXVERS)" @echo "PYENV installing Sphinx$(SPHINXVERS)"
$(Q)$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) 'Sphinx$(SPHINXVERS)' $(Q)$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) 'Sphinx$(SPHINXVERS)'
sphinx-live: $(PY_ENV) sphinx-live: sphinx-doc-prebuilds
@echo "PYENV installing Sphinx$(SPHINXVERS)" @echo "PYENV installing Sphinx$(SPHINXVERS)"
$(Q)$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) 'Sphinx$(SPHINXVERS)' sphinx-autobuild $(Q)$(PY_ENV_BIN)/pip install $(PIP_VERBOSE) 'Sphinx$(SPHINXVERS)' sphinx-autobuild
@ -115,7 +117,7 @@ quiet_cmd_sphinx_clean = CLEAN $@
# targets # targets
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# build PDF of whole documentation in: $(DOCS_DIST)/pdf # build PDF of whole documentation in: $(DOCS_DIST)/pdf
PHONY += sphinx-pdf PHONY += sphinx-pdf
sphinx-pdf: sphinx-latex sphinx-pdf: sphinx-latex