-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (33 loc) · 1.2 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
PROJECT_NAME = kitten
PROFILE = ../profiles/common
BUILD_DIR = build
BUILD_TESTS = ON
BUILD_TYPE = Debug
.PHONY: all test install compile gen dep mk clean env env-test env-format-check format-check format
all: compile
env:
docker build -t $(PROJECT_NAME) .
env-format-check: env
docker run --rm $(PROJECT_NAME) make format-check --no-print-directory
env-test: env
docker run --rm $(PROJECT_NAME) make compile test --no-print-directory
install:
cd $(BUILD_DIR) && cmake --build . --target install
test:
cd $(BUILD_DIR) && ctest -VV .
compile: gen
cd $(BUILD_DIR) && cmake --build .
gen: dep
cd $(BUILD_DIR) && cmake -D BUILD_TESTS=$(BUILD_TESTS) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) ..
dep: mk
cd $(BUILD_DIR) && conan install .. --build=missing -pr $(PROFILE) -s build_type=$(BUILD_TYPE)
mk:
mkdir -p $(BUILD_DIR)
clean:
rm -rf $(BUILD_DIR)
format-check:
@if git ls-files -- '*.cpp' '*.h' | xargs clang-format -style=file -output-replacements-xml | grep -q "<replacement "; then \
echo "Source code did not adhere to the expected formatting style"; exit 1; \
fi
format:
@git ls-files -- '*.cpp' '*.h' | xargs clang-format -i -style=file