-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
117 lines (93 loc) · 2.73 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dabeloos <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/03/05 17:21:38 by dabeloos #+# #+# #
# Updated: 2019/06/22 12:23:03 by pvanderl ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
OSMAKE :=
ifeq ($(OS),Windows_NT)
OSMAKE = mingw32-make.exe
else
OSMAKE = make
endif
CC = gcc
CFLAGS = -Wall -Wextra -Werror -O3
LIBHEAD = ./libft/includes
THISHEAD = ./inc
PRINT_F = lemin_error \
print
READ_F = legal_char_1 \
legal_char_2 \
read_1 \
read_2 \
read_ants \
read_command_1 \
read_command_2 \
read_room \
read_tube
STRUCTS_F = global \
room_1 \
room_2 \
room_3 \
room_4 \
tube_1 \
tube_2 \
ant \
path \
paths
MAIN_F = lemin
ALGO_F = algo_1 \
algo_2 \
algo_3 \
bfs \
bmf \
check_roads_1 \
check_roads_2 \
cost
O_FILES = $(addsuffix .o, \
$(addprefix ./src/, \
$(MAIN_F) \
$(addprefix read/, $(READ_F)) \
$(addprefix print/, $(PRINT_F)) \
$(addprefix structs/, $(STRUCTS_F)) \
$(addprefix algo/, $(ALGO_F))))
END_E = \033[00m
RED_E = \033[01;31m
GREEN_E = \033[01;32m
YELLOW_E = \033[01;33m
PURPLE_E = \033[01;35m
CYAN_E = \033[01;36m
WHITE_E = \033[01;37m
BOLD_E = \033[1m
UNDERLINE_E = \033[4m
$(NAME): $(O_FILES)
@$(OSMAKE) -C libft/
@$(CC) $(CFLAGS) -o $(NAME) $(O_FILES) -L./libft/ -lft
@echo "$(GREEN_E)end compilation : $(NAME)$(END_E)"
all: $(NAME)
small: $(O_FILES)
@$(CC) $(CFLAGS) -o $(NAME) $(O_FILES) -L./libft/ -lft
@echo "$(GREEN_E)end compilation : $(NAME)$(END_E)"
%.o: %.c
@$(CC) $(CFLAGS) -c -o $@ $< -I$(LIBHEAD) -I$(THISHEAD)
sclean:
@rm -f $(O_FILES)
@echo "$(PURPLE_E)end clean : $(NAME)$(END_E)"
clean: sclean
@$(OSMAKE) -C libft/ clean
fclean: sclean
@rm -f $(NAME)
@$(OSMAKE) -C libft/ fclean
@echo "$(RED_E)end fclean : $(NAME)$(END_E)"
sfclean: sclean
@rm -f $(NAME)
@echo "$(RED_E)end fclean : $(NAME)$(END_E)"
re: fclean all
sre: sfclean small
.PHONY: clean fclean all re small sclean sfclean sre