-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
59 lines (49 loc) · 1.87 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
# Programs
CMAKE = cmake
CTEST = ctest
PYTHON = python3
# 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 \
-DJSONBINPACK_NUMERIC:BOOL=ON \
-DJSONBINPACK_RUNTIME:BOOL=ON \
-DJSONBINPACK_COMPILER:BOOL=ON \
-DJSONBINPACK_TESTS:BOOL=ON \
-DJSONBINPACK_WEBSITE:BOOL=ON \
-DJSONBINPACK_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
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_alterschema
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_alterschema_dev
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_jsonbinpack
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component sourcemeta_jsonbinpack_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
doxygen: .always
$(CMAKE) --build ./build --config $(PRESET) --target doxygen
website: .always
$(CMAKE) --build ./build --config $(PRESET) --target website
$(PYTHON) -m http.server 3000 --directory build/www
clean: .always
$(CMAKE) -E rm -R -f build
# For NMake, which doesn't support .PHONY
.always: