-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (51 loc) · 1.28 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
58
59
60
61
62
63
64
65
66
67
##
## EPITECH PROJECT, 2021
## libmy Makefile
## File description:
## Makefile to build libmy.a
##
override CFLAGS += -fno-builtin -W -Wall -Wextra
override CPPFLAGS += -Iinclude -Llib -lmy
TESTSRC = tests/test_make.c \
tests/test_navy.c
TESTOBJ = $(TESTSRC:.c=.o)
MAINSRC = main.c
MAINOBJ = $(MAINSRC:.c=.o)
SRC = src/navy.c \
src/get_boat_position.c \
src/display.c \
src/utils.c \
src/signal/signal.c \
src/signal/signal_send_utils.c \
src/signal/signal_get_utils.c \
src/signal/user_input.c \
src/client/client.c \
src/client/get_connection.c \
src/server/server.c \
src/server/get_connection.c \
src/turn.c
OBJ = $(SRC:.c=.o)
NAME = navy
all: $(NAME)
$(NAME): $(OBJ) $(MAINOBJ)
make -C lib/my
gcc -o $(NAME) $(MAINOBJ) $(OBJ) $(CFLAGS) $(CPPFLAGS)
clean:
rm -f $(OBJ) $(MAINOBJ)
find . -type f -name '*.gcda' -delete
find . -type f -name '*.gcno' -delete
make clean -C lib/my
fclean: clean
rm -f $(NAME)
make fclean -C lib/my
re: fclean all
debug: CFLAGS += -g
debug: re
tests_run: CFLAGS += -lcriterion --coverage
tests_run: debug $(TESTOBJ)
gcc -o unit_tests $(TESTOBJ) $(SRC) $(CFLAGS) $(CPPFLAGS)
./unit_tests
cover:
gcovr --exclude tests
gcovr --exclude tests --branches
rm -f unit_tests*