blob: 47510f984deb34256a8011ceab5251a37209a191 [file] [log] [blame]
David Horstmann7cedefe2023-03-14 15:00:46 +00001# Minimal makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line, and also
5# from the environment for the first two.
6SPHINXOPTS ?=
7SPHINXBUILD ?= sphinx-build
8SOURCEDIR = .
9BUILDDIR = _build
10
11# Put it first so that "make" without argument is like "make help".
12help:
13 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
David Horstmanne51ef922023-03-27 15:21:27 +010015.PHONY: help clean apidoc breathe_apidoc Makefile
16
17# Intercept the 'clean' target so we can do the right thing for apidoc as well
18clean:
19 @# Clean the apidoc
20 $(MAKE) -C .. apidoc_clean
David Horstmann9d06c7d2023-03-28 14:24:47 +010021 @# Clean the breathe-apidoc generated files
22 rm -rf ./api
David Horstmanne51ef922023-03-27 15:21:27 +010023 @# Clean the sphinx docs
24 @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25
26apidoc:
27 @# Generate doxygen from source using the main Makefile
28 $(MAKE) -C .. apidoc
29
30breathe_apidoc: apidoc
31 @# Remove existing files - breathe-apidoc skips them if they're present
32 rm -rf ./api
33 @# Generate RST file structure with breathe-apidoc
34 breathe-apidoc -o ./api ../apidoc/xml
David Horstmann7cedefe2023-03-14 15:00:46 +000035
36# Catch-all target: route all unknown targets to Sphinx using the new
37# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
David Horstmanne51ef922023-03-27 15:21:27 +010038%: Makefile breathe_apidoc
39 @# Build the relevant target with sphinx
David Horstmann7cedefe2023-03-14 15:00:46 +000040 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)