File: Makefile

package info (click to toggle)
doxysphinx 3.3.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,296 kB
  • sloc: python: 2,974; javascript: 235; cpp: 88; makefile: 52; sh: 10
file content (73 lines) | stat: -rw-r--r-- 2,871 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## =====================================================================================
##  C O P Y R I G H T
## -------------------------------------------------------------------------------------
##  Copyright (c) 2023 by Robert Bosch GmbH. All rights reserved.
##
##  Author(s):
##  - Markus Braun, :em engineering methods AG (contracted by Robert Bosch GmbH)
## =====================================================================================

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINX_OPTS     =
BUILD_DIR       = .build
DOCS_SOURCE_DIR = .

.PHONY: help clean html doxygen doxysphinx sphinx

help:
	@echo "Please use make <target> where <target> is one of"
	@echo "  sphinx      to run sphinx."
	@echo "  doxygen     to run doxygen."
	@echo "  doxysphinx  to run doxysphinx."
	@echo "  html        to run everything in correct order to generate the documentation."
	@echo "  clean       to clean up everything"

clean:
	@poetry run doxysphinx --verbosity=DEBUG clean $(DOCS_SOURCE_DIR) $(BUILD_DIR)/html demo/demo.doxyfile
# cannot use rm here because it's not portable (win/linux)
	@poetry run python -c 'exec("import shutil\nimport glob\n\nfor result in glob.glob(\"docs/doxygen/demo/*\"): shutil.rmtree(result)")'
	@poetry run python -c 'exec("import shutil\nimport glob\n\nfor result in glob.glob(\"docs/doxygen/graphviz/*\"): shutil.rmtree(result)")'
	@poetry run python -c 'exec("import shutil\nimport glob\n\nfor result in glob.glob(\".build/*\"): shutil.rmtree(result)")'


# targets for demo project
doxygen_demo:
	@doxygen demo/demo.doxyfile

doxysphinx_demo:
	@poetry run doxysphinx --verbosity=DEBUG build $(DOCS_SOURCE_DIR) $(BUILD_DIR)/html demo/demo.doxyfile

doxysphinx_demo_with_dir:
	@poetry run doxysphinx --verbosity=DEBUG build $(DOCS_SOURCE_DIR) $(BUILD_DIR)/html docs/doxygen/demo/html

# targets for graphviz project
# -> ATTENTION: Before you can use them you have to download graphviz (see ./demo/load_additional_demos.sh)
doxygen_graphviz:
	@cd demo/graphviz; doxygen Doxyfile.in

doxysphinx_graphviz:
	@mkdir -p docs/doxygen/graphviz
	@cp -R demo/graphviz/doxygen/html docs/doxygen/graphviz
	@poetry run doxysphinx --verbosity=DEBUG build $(DOCS_SOURCE_DIR) $(BUILD_DIR)/html docs/doxygen/graphviz/html

# sphinx
sphinx:
	@poetry run sphinx-build -M html "$(DOCS_SOURCE_DIR)" "$(BUILD_DIR)" '--keep-going' '-j' 'auto' $(SPHINX_OPTS)

# for profiling...
profile: clean doxygen_demo
	@poetry run python -m cProfile -o .doxysphinx.prof doxysphinx/cli.py --verbosity=DEBUG build $(DOCS_SOURCE_DIR) $(BUILD_DIR) demo/demo.doxyfile
	@poetry run snakeviz .doxysphinx.prof
	@rm .doxysphinx.prof

# some aliases
doxygen: doxygen_demo

doxysphinx: doxysphinx_demo

html: doxygen doxysphinx sphinx
	@echo ""
	@echo "Build finished. The Documentation is in $(BUILD_DIR)/html."