-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (38 loc) · 1.16 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
ROOT = $(CURDIR)
ifeq ($(MAKECMDGOALS),coverage)
DEBUG = 1
endif
include common.mk
ifeq ($(MAKECMDGOALS),coverage)
$(OBJ): clean
endif
all: $(OUTPUT_BIN)
$(BUILD_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(CXXFLAGS) $< -o $@
$(OUTPUT_BIN): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $(OBJ) $(LDFLAGS)
clean: clean_coverage
rm -rf $(BUILD_DIR)
rm -rf coverage
rm -f $(OUTPUT_BIN)
rm -f $(DEP)
cd $(TESTS_DIR) && $(MAKE) $@
check functional_tests unit_tests: clean_coverage $(OUTPUT_BIN)
cd $(TESTS_DIR) && $(MAKE) DEBUG=1 $@
clean_coverage:
find . -iname "*.gcda" | xargs rm -f
coverage: unit_tests functional_tests
mkdir -p coverage
gcovr -r . -d --html --html-details -o coverage/coverage.html -e "third_party.*" -e ".*unit_tests.*"
CLANG_TIDY_CHECKS = *
CLANG_TIDY_CHECKS += ,-cert-err58-cpp
CLANG_TIDY_CHECKS += ,-google-runtime-references
CLANG_TIDY_CHECKS += ,-cppcoreguidelines-pro-type-reinterpret-cast
CLANG_TIDY_CHECKS += ,-cert-env33-c
tidy:
clang-tidy -checks='$(CLANG_TIDY_CHECKS)' src/gencc.cpp
cppcheck:
cppcheck --enable=all --inconclusive src tests/unit_tests -igoogletest
.PHONY: clean check unit_tests functional_tests coverage all
-include $(DEP)