forked from VeriFIT/mata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (24 loc) · 957 Bytes
/
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
BUILD_DIR=build
MAKE_FLAGS=-j 4
TEST_FLAGS=-j 50 --output-on-failure
.PHONY: all debug release coverage doc clean test
all:
./clean_gcda.sh
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && $(MAKE) $(MAKE_FLAGS) || echo "Type either \"make debug\" or \"make release\"!"
debug:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Debug .. && $(MAKE) $(MAKE_FLAGS)
release:
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Release .. && $(MAKE) $(MAKE_FLAGS)
coverage: clean
mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && cmake -DCMAKE_BUILD_TYPE=Coverage .. && $(MAKE) $(MAKE_FLAGS)
doc:
cd $(BUILD_DIR) && $(MAKE) $(MAKE_FLAGS) doc
test:
cd $(BUILD_DIR) && ctest $(TEST_FLAGS)
check:
cd $(BUILD_DIR) && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. && cppcheck --project=compile_commands.json --quiet --error-exitcode=1
install:
cd $(BUILD_DIR) && $(MAKE) install
clean:
cd $(BUILD_DIR) && rm -rf *
rm -rf doc