-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.server
133 lines (119 loc) · 4.76 KB
/
Makefile.server
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
CC = gcc -g
RM = rm -f
CFLAGS += -I./include -Wall -Wextra
LDFLAGS = -lm
NAME = zappy_server
SRCS = src/common/arg_parser/parsing_functions/arg_parser_string.c \
src/common/arg_parser/arg_parser_cleanup.c \
src/common/arg_parser/arg_parser_initialisation.c \
src/common/arg_parser/argument_regex.c \
src/common/arg_parser/parse_arguments.c \
src/common/circular_buffer/circbuff.c \
src/common/circular_buffer/circbuff_buf.c \
src/common/circular_buffer/circbuff_file.c \
src/common/circular_buffer/circbuff_print.c \
src/common/circular_buffer/circbuff_strings.c \
src/common/circular_buffer/circbuff_utils.c \
src/common/command_parser/command_parser.c \
src/common/command_parser/my_strtok.c \
src/common/linked_list/linked_list_add.c \
src/common/linked_list/linked_list_get.c \
src/common/linked_list/linked_list_delete.c \
src/common/linked_list/linked_list_create.c \
src/common/linked_list/linked_list_conditional.c \
src/common/linked_list/linked_list_basic.c \
src/common/linked_list/linked_list_advanced.c \
src/common/linked_list/list_clean.c \
src/common/map/map_create.c \
src/common/map/map_debug.c \
src/common/map/map_free.c \
src/common/map/map_print.c \
src/common/map/map_str_to_tile.c \
src/common/map/map_tile_to_str.c \
src/common/map/map_orientation.c \
src/common/map/map_food.c \
src/common/map/map_vector.c \
src/common/socket/socket_cleanup.c \
src/common/socket/socket_initialisation.c \
src/common/utils/str_append.c \
src/common/utils/tab_cpy.c \
src/server/argument/cleanup_server_arguments.c \
src/server/argument/server_check_arg.c \
src/server/argument/server_parse_arg.c \
src/server/argument/server_parse_arg_func.c \
src/server/commands/command_parse.c \
src/server/commands/command_exec.c \
src/server/commands/join_team.c \
src/server/commands/graphic_command_exec.c \
src/server/commands/ai_command_exec.c \
src/server/commands/ai_commands/broadcast.c \
src/server/commands/ai_commands/connect_nbr.c \
src/server/commands/ai_commands/eject.c \
src/server/commands/ai_commands/fork.c \
src/server/commands/ai_commands/forward.c \
src/server/commands/ai_commands/incantation.c \
src/server/commands/ai_commands/incantation_end.c \
src/server/commands/ai_commands/inventory.c \
src/server/commands/ai_commands/left.c \
src/server/commands/ai_commands/look.c \
src/server/commands/ai_commands/right.c \
src/server/commands/ai_commands/set.c \
src/server/commands/ai_commands/take.c \
src/server/commands/graphic_commands/bct.c \
src/server/commands/graphic_commands/mct.c \
src/server/commands/graphic_commands/msz.c \
src/server/commands/graphic_commands/pin.c \
src/server/commands/graphic_commands/plv.c \
src/server/commands/graphic_commands/ppo.c \
src/server/commands/graphic_commands/sgt.c \
src/server/commands/graphic_commands/sst.c \
src/server/commands/graphic_commands/tna.c \
src/server/connection/poll_accept.c \
src/server/connection/poll_cleanup.c \
src/server/connection/poll_initialisation.c \
src/server/connection/poll_loop.c \
src/server/team/team_cleanup.c \
src/server/team/team_initialisation.c \
src/server/team/team_search.c \
src/server/timer/server_timer.c \
src/server/timer/timer_action.c \
src/server/timer/timer_check.c \
src/server/timer/timer_cleanup.c \
src/server/timer/timer_initialisation.c \
src/server/user/user_action.c \
src/server/user/user_cleanup.c \
src/server/user/user_get.c \
src/server/user/user_initialisation.c \
src/server/user/user_quit.c \
src/server/user/user_search.c \
src/server/main.c \
src/server/send_messages.c \
src/server/server_cleanup.c \
src/server/server_initialisation.c \
src/server/server_loop.c \
src/server/game_end.c
OBJDIR = obj
OBJS = $(SRCS:%.c=$(OBJDIR)/%.o)
NB_SRCS := $(words $(SRCS))
COMPILATION_INDEX := 1
$(OBJDIR)/%.o : %.c
@if [ "$(CC)" != "gcc" ] && [ "$(COMPILATION_INDEX)" = "1" ]; then printf "%b" "\033[1;31mWarning Debug Flag\033[0m\n";fi
@printf "%b" "\033[1;32m[$(COMPILATION_INDEX)/$(NB_SRCS)]\033[0m "
@printf "%b" "\033[0;32mBuilding C object $@\033[0m\n"
@$(eval COMPILATION_INDEX=$(shell echo $$(($(COMPILATION_INDEX)+1))))
@mkdir -p $(OBJDIR)
@mkdir -p $(@D)
@$(CC) -c $< -o $@ $(CFLAGS)
all: $(NAME)
$(NAME): $(OBJS)
@printf "%b" "\033[1;32mLinking C executable $(NAME)\033[0m\n"
@$(CC) $(OBJS) $(CFLAGS) -o $(NAME) $(LDFLAGS)
clean:
@printf "%b" "\033[0;32mRemove C objects\033[0m\n"
@$(RM) $(OBJS)
@$(RM) -r $(OBJDIR)
fclean: clean
@printf "%b" "\033[0;32mRemove C executable\033[0m\n"
@$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re