-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.ai
116 lines (102 loc) · 4.46 KB
/
Makefile.ai
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
CC = gcc -g
RM = rm -f
CFLAGS += -I./include -Wall -Wextra
LDFLAGS = -lm -lpthread
NAME = zappy_ai
SRCS = src/ai_client/main.c \
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_vector.c \
src/common/map/map_food.c \
src/common/map/map_orientation.c \
src/common/socket/socket_cleanup.c \
src/common/socket/socket_initialisation.c \
src/common/utils/str_append.c \
src/ai_client/commands/send/broadcast.c \
src/ai_client/commands/send/connect_nbr.c \
src/ai_client/commands/send/eject.c \
src/ai_client/commands/send/fork.c \
src/ai_client/commands/send/forward.c \
src/ai_client/commands/send/incantation.c \
src/ai_client/commands/send/inventory.c \
src/ai_client/commands/send/left.c \
src/ai_client/commands/send/look.c \
src/ai_client/commands/send/right.c \
src/ai_client/commands/send/set.c \
src/ai_client/commands/send/take.c \
src/ai_client/help.c \
src/ai_client/connect.c \
src/ai_client/handle_server.c \
src/ai_client/commands/sender.c \
src/ai_client/commands/pre_requests.c \
src/common/utils/is_str.c \
src/ai_client/parser.c \
src/ai_client/tile_ratio.c \
src/ai_client/tile_ratio_list.c \
src/ai_client/ai/conditions.c \
src/ai_client/ai/follower.c \
src/ai_client/ai/launch_ai.c \
src/ai_client/ai/searcher.c \
src/ai_client/ai/shouter.c \
src/ai_client/commands/srv_requests.c \
src/ai_client/move_to_target.c \
src/ai_client/searcher_set_target.c \
src/ai_client/tile_actions.c \
src/ai_client/brodcasts/broadcast_parser.c \
src/ai_client/brodcasts/broadcast_parser_setters.c \
src/ai_client/brodcasts/broadcast_searcher.c \
src/ai_client/ai/test.c \
src/ai_client/brodcasts/broadcast_adder.c \
src/ai_client/brodcasts/broadcast_timer.c \
src/ai_client/ai/eater.c \
src/ai_client/cleanup.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