-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (35 loc) · 1.02 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
CC=gcc++
FLAGS=-Wall -Wextra -Werror --std=c++17
#ASAN= -fsanitize=address
#TEST_FLAGS=-lgtest
HTML=-lcov -t test -o rep.info -c -d ./
OPS= ./srcs/arithmetic.cpp \
./srcs/complement.cpp \
./srcs/determinant.cpp \
./srcs/inverse.cpp \
./srcs/transpose.cpp
TOOLS= ./tools/print_matrix.cpp \
./tools/GaussElimination.cpp \
./tools/ResizeMatrix.cpp
TESTS= ./tests/test.cpp
SRCS= $(OPS) $(TOOLS)
OBJS= $(SRCS:.c=.o)
rwildcard = $(foreach d, $(wildcard $(1:=/*)), $(call rwildcard,$d,$2) $(filter $(subst *,%,$2), $d))
.PHONY: clean s21_matrix_oop.a gcov_report test
all: clean gcov_report
test: s21_matrix_oop.a
@rm -rf build
@mkdir build
@cd build && cmake ../ && make && ./main
s21_matrix_oop.a: $(OBJS)
@ar rcs s21_matrix_oop.a $^
@ranlib s21_matrix_oop.a
gcov_report: test
$(HTML)
genhtml -o report rep.info
open report/index.html
clean:
@rm -rf s21_matrix_oop.a *.o *.gcno *.gcda *.gcov *.gch \
test ./test.DSYM *.png *.html *.css *.info \
$(call rwildcard,.,*.o) \
$(call rwildcard,.,*.html)