-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
42 lines (34 loc) · 1.11 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
# Programs
CMAKE = cmake
CTEST = ctest
CPACK = cpack
# Options
PRESET = Debug
SHARED = OFF
PREFIX = ./build/dist
all: configure compile test
configure: .always
$(CMAKE) -S . -B ./build \
-DCMAKE_BUILD_TYPE:STRING=$(PRESET) \
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON \
-DJSONSCHEMA_TESTS:BOOL=ON \
-DJSONSCHEMA_TESTS_CI:BOOL=OFF \
-DJSONSCHEMA_CONTINUOUS:BOOL=ON \
-DJSONSCHEMA_DEVELOPMENT:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=$(SHARED)
compile: .always
$(CMAKE) --build ./build --config $(PRESET) --target clang_format
$(CMAKE) --build ./build --config $(PRESET) --target shellcheck
$(CMAKE) --build ./build --config $(PRESET) --parallel 4
$(CMAKE) --install ./build --prefix $(PREFIX) --config $(PRESET) --verbose \
--component sourcemeta_jsonschema
$(CPACK) --config build/CPackConfig.cmake -B build/out -C $(PRESET)
lint: .always
$(CMAKE) --build ./build --config $(PRESET) --target clang_tidy
test: .always
$(CTEST) --test-dir ./build --build-config $(PRESET) \
--output-on-failure --progress --parallel
clean: .always
$(CMAKE) -E rm -R -f build
# For NMake, which doesn't support .PHONY
.always: