-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
120 lines (90 loc) · 3.26 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# This Makefile captures common developer build and test use cases.
MAKEFLAGS += --no-print-directory
# print help by default
help:
# install
# -------------------------------------------------------------------
# Set default variable values, if non-null
# * build=Debug creates binary artifacts with symbols, e.g. for gdb
# * cmake_verbose=true creates Makefiles that produce full compile lines when executed
build ?= Release
cmake_verbose ?= false
.PHONY: install
install: clean
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build} --cmake-verbose=${cmake_verbose}
@TILEDB_PATH=${tiledb} pip install -v -e apis/python
.PHONY: r-build
r-build: clean
@./scripts/bld --prefix=${prefix} --tiledb=${tiledb} --build=${build} --r-build
# incremental compile and update python install
# -------------------------------------------------------------------
.PHONY: update
update:
cd build && make -j && make install-libtiledbsoma
cp dist/lib/lib* apis/python/src/tiledbsoma/
# test
# -------------------------------------------------------------------
.PHONY: test
test: ctest
pytest apis/python/tests
.PHONY: ctest
ctest: data ctest_update
.PHONY: ctest_update
ctest_update:
ctest --test-dir build/libtiledbsoma -C Release --verbose --rerun-failed --output-on-failure
.PHONY: data
data:
cd test && rm -rf soco && tar zxf soco.tgz && cd ..
# format
# -------------------------------------------------------------------
# Skip files in apis/r/src which are:
# * nanoarrow.c/h
# * Auto-generated by Rcpp
# * Things which Dirk doesn't want to be format-checked
.PHONY: check-format
check-format:
@./scripts/run-clang-format.sh . clang-format 0 \
`find libtiledbsoma apis/python/src -name "*.cc" -or -name "*.cpp" -or -name "*.h" ! -name "nanoarrow.*"`
.PHONY: format
format:
@./scripts/run-clang-format.sh . clang-format 1 \
`find libtiledbsoma apis/python/src -name "*.cc" -or -name "*.cpp" -or -name "*.h" ! -name "nanoarrow.*"`
# clean
# -------------------------------------------------------------------
.PHONY: clean
clean:
@rm -rf build dist
.PHONY: cleaner
cleaner:
@printf "*** dry-run mode: remove -n to actually remove files\n"
git clean -ffdx -e .vscode -e test/tiledbsoma -n
# help
# -------------------------------------------------------------------
define HELP
Usage: make rule [options]
Rules:
install [options] Build C++ library and install python module
r-build [options] Build C++ static library with "#define R_BUILD" for R
update Incrementally build C++ library and update python module
test Run tests
check-format Run C++ format check
format Run C++ format
clean Remove build artifacts
Options:
build=BUILD_TYPE Cmake build type = Release|Debug|RelWithDebInfo|ASAN|TSAN|LSAN|UBSAN|MSAN|Coverage [Release]
prefix=PREFIX Install location [${PWD}/dist]
tiledb=TILEDB_DIST Absolute path to custom TileDB build
Examples:
Install Release build
make install
Install Debug build of libtiledbsoma and libtiledb
make install build=Debug
Install Release build with custom libtiledb
make install tiledb=$$PWD/../TileDB/dist
Incrementally build C++ changes and update the python module
make update
endef
export HELP
.PHONY: help
help:
@printf "$${HELP}"