Zappy - Year end project 2
This is a project that Epitech asked us to create in order to allow us to reveiw the notions of the current year.
Loading...
Searching...
No Matches
Makefile
Go to the documentation of this file.
1##
2## EPITECH PROJECT, 2024
3## Raytracer
4## File description:
5## Makefile
6##
7
8SRC_MAIN = ./src/main.c
9
10SRC = ./src/sub_main.c \
11\
12 ./src/utils/finder.c \
13 ./src/utils/free.c \
14 ./src/utils/writer.c \
15 ./src/utils/fill.c \
16 ./src/utils/array_utils.c \
17 ./src/utils/array_to_str.c \
18\
19 ./src/parsing/arg_parse.c \
20 ./src/parsing/check_arg_mandatory.c \
21 ./src/parsing/parameter_utils.c \
22 ./src/parsing/check_values_validity.c \
23 ./src/parsing/command_parse.c \
24\
25 ./src/server/server_initialization.c \
26 ./src/server/game_data_initialization.c \
27 ./src/server/client_management.c \
28 ./src/server/server_loop.c \
29 ./src/server/command_handling.c \
30\
31 ./src/show/show_game_data.c \
32
33SRC_TEST = ./tests/arg_parser_test.c
34
35CC = gcc
36
37RM = rm -rf
38
39OBJ = $(SRC:.c=.o)
40
41OBJ_TEST = $(SRC_TEST:.c=.o)
42
43OBJ_MAIN = $(SRC_MAIN:.c=.o)
44
45CFLAGS = -Wall -Wextra
46
47CPPFLAGS = -iquote ./include
48
49TESTFLAGS = --coverage -lcriterion
50
51NAME = zappy_server
52
53NAME_TEST = $(NAME)_test
54
55all: $(NAME) update_binary_location
56
57$(NAME): $(OBJ) $(OBJ_MAIN)
58 $(CC) $(OBJ_MAIN) $(OBJ) -o $(NAME)
59
60update_binary_location:
61 cp -vf $(NAME) ../../$(NAME)
62
63clean:
64 $(RM) $(OBJ_MAIN)
65 $(RM) $(OBJ)
66 $(RM) $(OBJ_TEST)
67 $(RM) *.gcno
68 $(RM) *.gcda
69
70fclean: clean
71 $(RM) $(NAME)
72 $(RM) ../../$(NAME)
73 $(RM) $(NAME_TEST)
74
75re: fclean all
76
77debug: CFLAGS += -g3
78debug: clean all
79
80tests_run:
81 $(CC) $(SRC) $(SRC_TEST) -o $(NAME_TEST) $(TESTFLAGS) $(CFLAGS) $(CPPFLAGS)
82 ./$(NAME_TEST)
83
84coverage: tests_run
85 gcovr --exclude ./tests
86 gcovr --exclude ./tests --branches
87
88.PHONY: all clean fclean re debug tests_run coverage update_binary_location