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