-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (36 loc) · 1.19 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
# Programs
CMAKE = cmake
CTEST = ctest
# Options
PRESET = Debug
SHARED = OFF
BACKEND = JavaScriptCore
all: configure compile test
configure: .always
$(CMAKE) -S . -B ./build \
-DCMAKE_BUILD_TYPE:STRING=$(PRESET) \
-DCMAKE_COMPILE_WARNING_AS_ERROR:BOOL=ON \
-DINCLUDEJS_BACKEND:STRING=$(BACKEND) \
-DINCLUDEJS_ENGINE:BOOL=ON \
-DINCLUDEJS_TESTS:BOOL=ON \
-DINCLUDEJS_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 includejs
$(CMAKE) --install ./build --prefix ./build/dist --config $(PRESET) --verbose \
--component includejs_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
clean: .always
$(CMAKE) -E rm -R -f build
# For NMake, which doesn't support .PHONY
.always: