-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (41 loc) · 1.48 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
54
55
56
CFLAGS = -Wall -Wextra -Werror -pedantic -std=c11 -fsanitize=address -g
GCOVFLAGS = -fprofile-arcs -ftest-coverage
HEADERS = s21_string.h
SOURCES = $(wildcard ./CORE/*.c)
OBJ_LIBRARY := $(patsubst %.c, %.o, $(SOURCES))
%.o: %.c $(HEADER)
gcc $(CFLAGS) -c $< -o $@
all: s21_string.a gcov_report test
s21_string.a: $(OBJ_LIBRARY) $(HEADERS)
ar rcs s21_string.a $(OBJ_LIBRARY)
ranlib s21_string.a
rm -rf ./*/*.o
test: s21_string.a TESTS/SUITE_main.c
gcc $(CFLAGS) TESTS/SUITE_main.c s21_string.a -o test.out -lm -lcheck
./test.out
personal: s21_string.a TESTS/personal.c
gcc $(CFLAGS) TESTS/personal.c s21_string.a -o test.out -lm
./personal.out
test_1: s21_string.a TESTS/SUITE_aux__1.c
gcc $(CFLAGS) TESTS/SUITE_aux__1.c s21_string.a -o test.out -lm -lcheck
./test_1.out
test_2: s21_string.a TESTS/SUITE_aux__2.c
gcc $(CFLAGS) TESTS/SUITE_aux__2.c s21_string.a -o test.out -lm -lcheck
./test_2.out
test_3: s21_string.a TESTS/SUITE_aux__3.c
gcc $(CFLAGS) TESTS/SUITE_aux__3.c s21_string.a -o test.out -lm -lcheck
./test_3.out
gcov_report: s21_string.a TESTS/SUITE_main.c
gcc $(GCOVFLAGS) TESTS/SUITE_main.c $(SOURCES) -o report.out -lm -lcheck
./report.out
gcov -f $(SOURCES)
lcov -t "gcov_report" -o Coverage_Report.info -c -d .
genhtml -o ./report Coverage_Report.info
rm -f *.gcno *.gcda *.info report.out *.gcov
open ./report/index-sort-f.html
check:
clang-format -style=Google -n ./*/*.c
rebuild: clean all
clean:
rm -f *.o *.a *.gcno *.gcda *.info *.out *.gcov
rm -rf ./report