-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
57 lines (42 loc) · 1.04 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
57
##
## EPITECH POOL CHALLENGE, 2023
## general makefile
##
.SUFFIXES: .o
SRC := $(shell find . -name "*.c")
OBJ := $(SRC:.c=.o)
COV = $(wildcard *.gc??)
NAME := superlib.a
TESTNAME := test.bin
CRITOPATH := ./criterion
all: $(NAME)
$(NAME): $(OBJ)
@ $(AR) rc $@ $^
@ echo "Library compiled successfully"
clean:
@ $(RM) $(OBJ)
@ echo "Cleaned .o"
fclean: clean
@ $(RM) $(NAME)
@ echo "Cleaned '$(NAME)'"
@ $(RM) $(TESTNAME) $(COV)
@ echo "Cleaned '$(TESTNAME)' binary & residual files"
.NOTPARALLEL: re
re: fclean all
$(TESTNAME): $(OBJ)
@ gcc -o $(TESTNAME) $(OBJ) \
-fprofile-arcs -ftest-coverage -g3 \
-I $(CRITOPATH)/include -L $(CRITOPATH)/lib \
-lcriterion
.NOTPARALLEL: run
run: fclean $(TESTNAME)
@ ./$(TESTNAME) --verbose
runc: run
@ gcovr \
--exclude $(wildcard exercises/*/tests.c) \
--exclude-unreachable-branches \
--sort-key uncovered-percent \
--print-summary
norm:
@ ruby normono.rb
.PHONY: all clean fclean re run runc norm