| David Horstmann | 241b040 | 2023-03-14 15:00:46 +0000 | [diff] [blame] | 1 | # 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. | 
|  | 6 | SPHINXOPTS    ?= | 
|  | 7 | SPHINXBUILD   ?= sphinx-build | 
|  | 8 | SOURCEDIR     = . | 
|  | 9 | BUILDDIR      = _build | 
|  | 10 |  | 
|  | 11 | # Put it first so that "make" without argument is like "make help". | 
|  | 12 | help: | 
|  | 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | 
|  | 14 |  | 
| David Horstmann | 1c40d75 | 2023-03-27 15:21:27 +0100 | [diff] [blame] | 15 | .PHONY: help clean apidoc breathe_apidoc Makefile | 
|  | 16 |  | 
|  | 17 | # Intercept the 'clean' target so we can do the right thing for apidoc as well | 
|  | 18 | clean: | 
|  | 19 | @# Clean the apidoc | 
|  | 20 | $(MAKE) -C .. apidoc_clean | 
| David Horstmann | 9a2ddfd | 2023-03-28 14:24:47 +0100 | [diff] [blame] | 21 | @# Clean the breathe-apidoc generated files | 
|  | 22 | rm -rf ./api | 
| David Horstmann | 1c40d75 | 2023-03-27 15:21:27 +0100 | [diff] [blame] | 23 | @# Clean the sphinx docs | 
|  | 24 | @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | 
|  | 25 |  | 
|  | 26 | apidoc: | 
|  | 27 | @# Generate doxygen from source using the main Makefile | 
|  | 28 | $(MAKE) -C .. apidoc | 
|  | 29 |  | 
|  | 30 | breathe_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 Horstmann | 241b040 | 2023-03-14 15:00:46 +0000 | [diff] [blame] | 35 |  | 
|  | 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 Horstmann | 1c40d75 | 2023-03-27 15:21:27 +0100 | [diff] [blame] | 38 | %: Makefile breathe_apidoc | 
|  | 39 | @# Build the relevant target with sphinx | 
| David Horstmann | 241b040 | 2023-03-14 15:00:46 +0000 | [diff] [blame] | 40 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |