-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 729 Bytes
/
Copy pathMakefile
File metadata and controls
39 lines (27 loc) · 729 Bytes
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
CC := g++
CFLAGS := -Wall -Werror -Wextra -std=c++17
test_flags=--coverage
.PHONY: all clean test
all: MyMatrix.a
build: myMatrix.cpp
$(CC) $(CFLAGS) -c -lstdc++ myMatrix.cpp -o MyMatrix.o
MyMatrix.a: build
ar rcs MyMatrix.a MyMatrix.o
ranlib MyMatrix.a
clean:
rm -f *.o *.a test *.gcda *.gcno *.gcov mymatrix.info
rm -rf report
rebuild: clean all
leaks: test
valgrind --leak-check=full ./test
test:
$(CC) $(CFLAGS) $(test_flags) myMatrix.cpp test.cpp -o test -lgtest -lgmock -pthread
./test
gcov_report: clean test
lcov -t "test" -o mymatrix.info --no-external -c -d .
genhtml -o report mymatrix.info
#$(open) ./report/index.html
clang-format:
clang-format -i *.cpp
clang-check:
clang-format -n *.cpp