Skip to content

Commit

Permalink
doc Makefile: convert to a real Makefile to get rid of duplication
Browse files Browse the repository at this point in the history
Zero user interface or functional change.

Also change undocumented cmake -H option to documented -S
https://stackoverflow.com/questions/31090821/what-does-the-h-option-means-for-cmake

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
  • Loading branch information
marc-hb authored and nashif committed Jan 12, 2021
1 parent 2fd1d3c commit 43187e2
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
BUILDDIR ?= doc/_build
DOC_TAG ?= development
SPHINXOPTS ?= -q
KCONFIG_TURBO_MODE ?= 0

# Documentation targets
# ---------------------------------------------------------------------------
clean:
rm -rf ${BUILDDIR}

htmldocs:
mkdir -p ${BUILDDIR} && cmake -GNinja -DDOC_TAG=${DOC_TAG} -DSPHINXOPTS=${SPHINXOPTS} -B${BUILDDIR} -Hdoc/ && ninja -C ${BUILDDIR} htmldocs

htmldocs-fast:
mkdir -p ${BUILDDIR} && cmake -GNinja -DKCONFIG_TURBO_MODE=1 -DDOC_TAG=${DOC_TAG} -DSPHINXOPTS=${SPHINXOPTS} -B${BUILDDIR} -Hdoc/ && ninja -C ${BUILDDIR} htmldocs
${MAKE} htmldocs KCONFIG_TURBO_MODE=1

htmldocs pdfdocs doxygen: configure
cmake --build ${BUILDDIR} -- $@ # -v # VERBOSE=1

pdfdocs:
mkdir -p ${BUILDDIR} && cmake -GNinja -DDOC_TAG=${DOC_TAG} -DSPHINXOPTS=${SPHINXOPTS} -B${BUILDDIR} -Hdoc/ && ninja -C ${BUILDDIR} pdfdocs
# Run CMake every time cause it's quick and re-configures TURBO_MODE if
# needed
.PHONY: configure
configure:
cmake -GNinja -B${BUILDDIR} -Sdoc/ -DDOC_TAG=${DOC_TAG} \
-DSPHINXOPTS=${SPHINXOPTS} \
-DKCONFIG_TURBO_MODE=${KCONFIG_TURBO_MODE}

doxygen:
mkdir -p ${BUILDDIR} && cmake -GNinja -DDOC_TAG=${DOC_TAG} -DSPHINXOPTS=${SPHINXOPTS} -B${BUILDDIR} -Hdoc/ && ninja -C ${BUILDDIR} doxygen
.PHONY: clean htmldocs htmldocs-fast pdfdocs doxygen

0 comments on commit 43187e2

Please sign in to comment.