1# ------------------------------------------------------------------------------
2# Makefile for documentation build
3# SPDX-License-Identifier: Apache-2.0
4
5BUILDDIR ?= _build
6DOC_TAG ?= development
7SPHINXOPTS ?= -j auto
8LATEXMKOPTS ?= -halt-on-error -no-shell-escape
9KCONFIG_TURBO_MODE ?= 0
10
11# ------------------------------------------------------------------------------
12# Documentation targets
13
14.PHONY: configure clean html html-fast latex pdf doxygen
15
16html-fast:
17	${MAKE} html KCONFIG_TURBO_MODE=1
18
19html latex pdf doxygen: configure
20	cmake --build ${BUILDDIR} --target $@
21
22configure:
23	cmake \
24		-GNinja \
25		-B${BUILDDIR} \
26		-S. \
27		-DDOC_TAG=${DOC_TAG} \
28		-DSPHINXOPTS="${SPHINXOPTS}" \
29		-DLATEXMKOPTS="${LATEXMKOPTS}" \
30		-DKCONFIG_TURBO_MODE=${KCONFIG_TURBO_MODE}
31
32clean:
33	cmake --build ${BUILDDIR} --target clean
34