-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
59 lines (46 loc) · 1.54 KB
/
Makefile
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
# Minimal makefile for Sphinx documentation
#
default: help
.PHONY: default
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
SPHINXAUTOBUILD = sphinx-autobuild
SPHINXAUTOBUILDOPTS = \
--watch "$(SOURCEDIR)" \
--ignore '*~' \
--ignore '*.swp' \
--ignore '*.swx' \
--re-ignore '4913$$' \
--re-ignore '\.git/'
# Helper variable to generate help messages in the same format as Sphinx
_helpline = " \033[1;34m$(shell printf '%-12s' $(1))\033[0m$(2)"
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo
@echo "Additional targets (not provided by Sphinx):"
@echo $(call _helpline,check-uml,to generate PNG/SVG from UML sources locally)
@echo $(call _helpline,livehtml,to automatically rebuild HTML files)
.PHONY: help Makefile
livehtml:
@$(SPHINXAUTOBUILD) $(SPHINXAUTOBUILDOPTS) $(SPHINXOPTS) $(O) "$(SOURCEDIR)" "$(BUILDDIR)"
# PlantUML diagrams
SOURCES := $(wildcard *.uml)
diagrams: diagrams-png diagrams-svg
.PHONY: diagrams
diagrams-png: $(patsubst %.uml,%.png,$(SOURCES))
.PHONY: diagrams-png
diagrams-svg: $(patsubst %.uml,%.svg,$(SOURCES))
.PHONY: diagrams-svg
%.png: %.uml
@echo Rendering $< into $@
@plantuml -p -tpng > $@ < $<
%.svg: %.uml
@echo Rendering $< into $@
@plantuml -p -tsvg > $@ < $<
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)