This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (57 loc) · 2.27 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
68
69
70
71
72
73
74
75
76
##
## EPITECH PROJECT, 2024
## myftp
## File description:
## Makefile
##
SRC = src/core.c \
src/parser.c \
src/tools.c \
src/server/server.c \
src/server/socket.c \
src/client/client.c \
src/commands/handle_inputs.c \
src/commands/cmd_tools.c \
src/commands/handlers/cdup.c \
src/commands/handlers/cwd.c \
src/commands/handlers/dele.c \
src/commands/handlers/help.c \
src/commands/handlers/list.c \
src/commands/handlers/noop.c \
src/commands/handlers/pass.c \
src/commands/handlers/pasv.c \
src/commands/handlers/port.c \
src/commands/handlers/pwd.c \
src/commands/handlers/quit.c \
src/commands/handlers/retr.c \
src/commands/handlers/stor.c \
src/commands/handlers/user.c \
SRC_MAIN = src/main.c
SRC_TEST = units_tests/test.c
OBJ = $(SRC_MAIN:.c=.o) \
$(SRC:.c=.o)
OBJ_TEST = $(SRC_TEST:.c=.o) \
$(SRC:.c=.o)
INC = -I./include
CFLAGS = -W -Wall -Werror -Wextra $(INC) -std=c17 -D_GNU_SOURCE
LDFLAGS = --coverage -lcriterion
NAME = myftp
NAME_TEST = unit_tests
RM = rm -f
$(NAME): $(OBJ)
gcc -o $(NAME) $(OBJ) $(CFLAGS)
all: $(NAME)
debug: CFLAGS += -g3 -ggdb
debug: re
clean:
$(RM) $(OBJ) $(OBJ_TEST)
fclean: clean
$(RM) $(NAME) $(NAME_TEST)
find . -name "*.gcda" -delete -or -name "*.gcno" -delete
find . -name "*.log" -delete
tests_run: CFLAGS += $(LDFLAGS)
tests_run: $(OBJ_TEST)
gcc -o $(NAME_TEST) $(OBJ_TEST) $(CFLAGS)
./unit_tests --verbose
re: fclean all
.PHONY: all debug clean fclean tests_run re