-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
84 lines (54 loc) · 1.76 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.DEFAULT_PREFIX=/usr/local
.TEST_BUILD_DIR=./build
.VENV_DIR=./.venv
prefix=$(.DEFAULT_PREFIX)
define HELP_BODY
Please use 'make [target]'.
TARGETS
install [prefix=<path>] Install Jet headers to <path>/include, defaults to $(.DEFAULT_PREFIX)
uninstall [prefix=<path>] Remove Jet headers from <path>/include, defaults to $(.DEFAULT_PREFIX)
test Build and run C++ tests (requires CMake)
dist Build the Python source and wheel distributions
docs Build docs (requires Doxygen, Pandoc and pip)
format [check=1] Apply C++ formatter; use with 'check=1' to check instead of modify (requires clang-format)
clean Remove all build artifacts
endef
.PHONY: help
help:
@: $(info $(HELP_BODY))
.PHONY: format
format:
ifdef check
./bin/format --check include python/src test
else
./bin/format include python/src test
endif
.PHONY: install
install: ./include/Jet.hpp ./include/jet
mkdir -p $(prefix)/include
cp -r $^ $(prefix)/include/
.PHONY: docs
uninstall:
rm -r $(prefix)/include/jet $(prefix)/include/Jet.hpp
.PHONY: test
test: $(.TEST_BUILD_DIR)
cd $(.TEST_BUILD_DIR) && $(MAKE)
$(.TEST_BUILD_DIR)/test/runner
.PHONY: dist
dist:
cd python && $(MAKE) dist
.PHONY: docs
docs: $(.VENV_DIR) dist
$(.VENV_DIR)/bin/pip install -q $(wildcard dist/*.whl) --upgrade
. $(.VENV_DIR)/bin/activate; cd docs && $(MAKE) html SPHINXOPTS="-W --keep-going"
.PHONY: clean
clean:
rm -rf ./docs/_build ./docs/api ./docs/code/api ./docs/doxyoutput
rm -rf $(.TEST_BUILD_DIR) $(.VENV_DIR) ./dist
$(.VENV_DIR):
python3 -m venv $@
$@/bin/pip install -q wheel
$@/bin/pip install -q -r docs/requirements.txt
$(.TEST_BUILD_DIR):
mkdir -p $@
cd $@ && cmake -DBUILD_TESTS=ON ../