-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
152 lines (136 loc) · 9.11 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: cbaillat <cbaillat@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/11/13 18:12:06 by cbaillat #+# #+# #
# Updated: 2018/03/05 09:34:22 by cbaillat ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
CC = gcc
# CFLAGS = -Wall -Wextra -Werror
# CFLAGS = -Wall -Wextra -fsanitize=address
CFLAGS = -Wall -Wextra -Werror
# sources
VPATH += ./srcs:./srcs/parsing:./srcs/algorithm
VPATH += ./srcs/move_ants:./srcs/utilities
SRCS = lem_in.c \
error_manager.c
SRCS += algorithm.c \
edmonds_karp.c
SRCS += get_ants.c \
get_rooms.c \
parse_room.c \
parse_tube.c \
parsing.c
SRCS += mv_ants.c
SRCS += edmonds_karp_utilities.c \
flag_management.c \
input_utilities.c \
map_utilities.c \
path_utilities.c \
print.c \
string_utilities.c \
room_utilities.c \
way_utilities.c
# object files
OBJ_DIR := ./obj
OBJECTS += $(patsubst %,$(OBJ_DIR)/%,$(SRCS:.c=.o))
# objects dependencies
DEPS = $(OBJECTS:.o:.d)
DEPS_FLAGS = -MMD -MP
# includes
INC_DIR := ./includes
INC_DIR += ./libft/includes
IFLAGS += $(foreach d, $(INC_DIR), -I$d)
# libraries
LIB_DIR := ./libft
LIBS := ft
LIB_FLAGS := -L$(LIB_DIR) -l$(LIBS)
# echo output colours
RED = \033[1;31m
GREEN = \033[1;32m
YELLOW = \033[1;33m
BLUE = \033[1;34m
PURPLE = \033[1;35m
CYAN = \033[1;36m
WHITE = \033[1;37m
ORANGE = \033[1;38m
NC = \033[0m
.PHONY: all clean fclean re
all:
@make -C $(LIB_DIR)/
@make $(NAME)
$(NAME): $(OBJECTS)
@echo "[Building ${RED}lem_in${NC}]"
@$(CC) $(CFLAGS) $(OBJECTS) $(LIB_FLAGS) -o $(NAME)
$(OBJ_DIR)/%.o:%.c
@echo "[Building ${RED}lem_in${NC} object: $@]"
@mkdir -p $(OBJ_DIR)
@$(CC) $(CFLAGS) $(DEPS_FLAGS) $(IFLAGS) -o $@ -c $<
clean:
@make clean -C $(LIB_DIR)/
@echo "[Cleaning ${RED}lem_in${NC} objects]"
@rm -rf $(OBJ_DIR)
fclean: clean
@make fclean -C $(LIB_DIR)/
@echo "[Cleaning ${RED}lem_in${NC} binary]"
@rm -rf $(NAME)
re: fclean all
order:
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++++++++++++///+++++++++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++++++++++++++++/:. .-/++++++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++++++++++++/:- -:/++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++/:. . .:/+++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++//-. -:///:- .-:/+++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++/:- .://+++++++//-. .:/++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++//:. -:/+++++++++++++++/:. .-//++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++/:- .-//+++++++++++++++++//-. -:/+++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++//:. .-. -:/+++++++++++++++++//:. .://+++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++/:-. -:/+++/:- -:/++++++++++++++++++/:-. -:/++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++/:. .-//+++++++++/:-. .:/++++++++++++++++++//:. .://++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++//-. .:/++++++++++++++++//- .-//++++++++++++++++++/:- .-:/+++++++++++\033[0m"
@echo "\033[38;5;202m++++++++/- .-:/++++++++++++++++++//-. -:/++++++++++++++++++//-. -/+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: .:/+++++++++++++++++++/:- .-. .://++++++++++++++++++/:. -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: ./++++++++++++++++++//:. -:/+++/:- .-//++++++++++++++++++/- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -++++++++++++++++/:- .-//+++++++++//-. -://+++++++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -++++++++++++//:. -:/+++++++++++++++++/:- .://++++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++: .-//+++++++++++++++++++++++//-. :+++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++. .:/+++++++++++++++++++++++++++++++/:. ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++. :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++. :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++. :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++. :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ ./++++++++++- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ ./+++++++++/. -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ ./+++++/:- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ ./++/-. -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ :- .. -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ :+++++++++++++++++++++++++++++++++++++/ -:/+: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ .:/+++++++++++++++++++++++++++++++++/:. .-//++++: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ .-//+++++++++++++++++++++++++//-. -://+++++++: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ -:/+++++++++++++++++++/:. .-//+++++++++++: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ -. .:/++++++++++++//-. .://++++++++++++++: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -+++++++++++ /+/:-. -:/+++++/:- -:/++++++++++++++++++: -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++: -:/++++++++ /++++//:. .:/-. .-//++++++++++++++++++/:- -+++++++++\033[0m"
@echo "\033[38;5;202m++++++++/ .://++++ /++++++++/:- .:/++++++++++++++++++//:. :+++++++++\033[0m"
@echo "\033[38;5;202m+++++++++//-. .-:/+ /+++++++++++//-. .-:/++++++++++++++++++//-. .-:/++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++/:. . /+++++++++++++++/:. .://++++++++++++++++++/:- .://+++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++/:-. /++++++++++++++++++/++++++++++++++++++//:. -:/+++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++//:. -:/+++++++++++++++++++++++++++++++/:- .-//++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++/:- .://+++++++++++++++++++++++//:. -:/++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++//-. .-:/+++++++++++++++++//-. .-:/+++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++/:. .://+++++++++//:- .:/+++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++++/:- .-//+++//-. -:/++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++++++++/:. -:- .-/++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++++/:- -:/+++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++++++++/-. .-/+++++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m+++++++++++++++++++++++++++++++++++++++++++++++/:-:/++++++++++++++++++++++++++++++++++++++++++++++++\033[0m"
@echo "\033[38;5;202m++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\033[0m"
# include all dependicy files
-include $(DEPS)