forked from QuentindiMeo/tek-pool-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (37 loc) · 832 Bytes
/
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
##
## EPITECH POOL CHALLENGE, 2023
## general makefile
##
.SUFFIXES: .o
CC ?= gcc
SRC := $(shell find exercises -name "*.c")
TEST_SRC := $(shell find tests -name "*.c")
OBJ := $(SRC:.c=.o)
TEST_OBJ := $(TEST_SRC:.c=.o)
NAME := superlib.a
TEST_FILENAME := tests.out
.PHONY: all
all: $(NAME)
$(NAME): $(OBJ)
$(AR) rc $@ $^
.PHONY: clean
clean:
$(RM) $(OBJ) $(TEST_OBJ)
.PHONY: fclean
fclean: clean
$(RM) $(NAME) $(TEST_FILENAME)
$(RM) $(wildcard $(TEST_FILENAME)-*.gc??) $(TEST_SRC:.c=.gcno)
.PHONY: re
.NOTPARALLEL: re
re: fclean all
$(TEST_FILENAME): CFLAGS += -fprofile-arcs -ftest-coverage
$(TEST_FILENAME): $(TEST_OBJ) $(SRC)
$(CC) $(CFLAGS) -o $@ $^ -lcriterion
.PHONY: run
.NOTPARALLEL: run
run: fclean $(TEST_FILENAME)
./$(TEST_FILENAME) --verbose
.PHONY: runc
runc: run
gcovr -e tests
gcovr -e tests -bu