-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
46 lines (36 loc) · 1.24 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
# Programs
CMAKE = cmake
CTEST = ctest
# Options
PRESET = Debug
SHARED = OFF
all: configure compile test
configure: .always
$(CMAKE) -S . -B ./build \
-DCMAKE_BUILD_TYPE:STRING=$(PRESET) \
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON \
-DJSONTOOLKIT_TESTS:BOOL=ON \
-DJSONTOOLKIT_BENCHMARK:BOOL=ON \
-DJSONTOOLKIT_DOCS:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=$(SHARED)
compile: .always
$(CMAKE) --build ./build --config $(PRESET) --target clang_format
$(CMAKE) --build ./build --config $(PRESET) --parallel 4
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_jsontoolkit
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_jsontoolkit_dev
lint: .always
$(CMAKE) --build ./build --config $(PRESET) --target clang_tidy
test: .always
$(CMAKE) -E env UBSAN_OPTIONS=print_stacktrace=1 \
$(CTEST) --test-dir ./build --build-config $(PRESET) \
--output-on-failure --progress --parallel
benchmark: .always
$(CMAKE) --build ./build --config $(PRESET) --target benchmark_all
doxygen: .always
$(CMAKE) --build ./build --config $(PRESET) --target doxygen
clean: .always
$(CMAKE) -E rm -R -f build
# For NMake, which doesn't support .PHONY
.always: