-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
executable file
·145 lines (131 loc) · 5.05 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dasereno <dasereno@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/09 13:04:45 by tnard #+# #+# #
# Updated: 2022/05/21 16:58:29 by dasereno ### ########.fr #
# #
# **************************************************************************** #
BLU = \033[0;34m
GRN = \033[0;32m
RED = \033[0;31m
RST = \033[0m
END = \e[0m
SRCS = srcs/main.c srcs/utils.c srcs/utils_2.c srcs/generate/parsing.c srcs/generate/parsing_2.c srcs/generate/texture.c srcs/generate/image.c srcs/generate/other.c srcs/generate/map.c srcs/generate/free.c srcs/displaying/map.c srcs/displaying/score.c srcs/displaying/map_win.c srcs/handling/key.c srcs/handling/update.c
SRCS_B = srcs_bonus/main_bonus.c \
srcs_bonus/utils_bonus.c \
srcs_bonus/utils_2_bonus.c \
\
srcs_bonus/editor_maps/key.c \
srcs_bonus/editor_maps/updating.c \
\
srcs_bonus/global_handling/launch_wins.c \
srcs_bonus/global_handling/global_update.c \
srcs_bonus/global_handling/global_update_2.c \
srcs_bonus/global_handling/update_and_key_call.c \
\
srcs_bonus/displaying/map_bonus.c \
srcs_bonus/displaying/score_bonus.c \
srcs_bonus/displaying/map_win_bonus.c \
\
srcs_bonus/handling/clock_bonus.c \
srcs_bonus/handling/key_bonus.c \
srcs_bonus/handling/update_bonus.c \
\
srcs_bonus/guards/list_bonus.c \
srcs_bonus/guards/random_bonus.c \
srcs_bonus/guards/check_bonus.c \
\
srcs_bonus/menu/menu.c \
srcs_bonus/menu/update.c \
srcs_bonus/menu/key.c \
\
srcs_bonus/editor/map_and_map_top.c \
srcs_bonus/editor/map_blocks.c \
srcs_bonus/editor/key.c \
srcs_bonus/editor/special_key.c \
srcs_bonus/editor/mini.c \
srcs_bonus/editor/updating.c \
\
srcs_bonus/editor_menu/key.c \
srcs_bonus/editor_menu/updating.c \
srcs_bonus/editor_menu/parsing.c \
\
srcs_bonus/generate/parsing_bonus.c \
srcs_bonus/generate/parsing_2_bonus.c \
srcs_bonus/generate/image_bonus.c \
srcs_bonus/generate/init_global.c \
srcs_bonus/generate/init_global_2.c \
srcs_bonus/generate/map_bonus.c \
srcs_bonus/generate/free_bonus.c \
srcs_bonus/generate/textures/mini.c \
srcs_bonus/generate/textures/player.c \
srcs_bonus/generate/textures/slime.c \
srcs_bonus/generate/textures/special.c \
srcs_bonus/generate/textures/sprites.c \
srcs_bonus/generate/textures/wall.c
NAME = so_long
NAME_B = so_long_bonus
minilibx = mlx/libmlx.a
OBJS_DIR = objs/
OBJS_DIR_B = objs_b/
OBJS = $(SRCS:.c=.o)
OBJS_B = $(SRCS_B:.c=.o)
OBJECTS_PREFIXED = $(addprefix $(OBJS_DIR), $(OBJS))
OBJECTS_PREFIXED_B = $(addprefix $(OBJS_DIR_B), $(OBJS_B))
CC = gcc
CC_FLAGS = -Wall -Werror -Wextra
MLB_FLAGS = -I -g3 -L /usr/X11/lib -Lincludes -L./mlx -lmlx -Imlx -lXext -lX11 -lz -lm libft/libft.a ft_printf/libftprintf.a
$(OBJS_DIR)%.o : %.c includes/so_long.h
@mkdir -p $(OBJS_DIR)
@mkdir -p $(OBJS_DIR)srcs
@mkdir -p $(OBJS_DIR)srcs/generate
@mkdir -p $(OBJS_DIR)srcs/displaying
@mkdir -p $(OBJS_DIR)srcs/handling
@$(CC) $(CC_FLAGS) -c $< -o $@
@printf "\033[2K\r${BLU}[BUILD - $(NAME)]${RST} '$<' $(END)"
$(OBJS_DIR_B)%.o : %.c includes_bonus/so_long_bonus.h
@mkdir -p $(OBJS_DIR_B)
@mkdir -p $(OBJS_DIR_B)srcs_bonus
@mkdir -p $(OBJS_DIR_B)srcs_bonus/generate
@mkdir -p $(OBJS_DIR_B)srcs_bonus/generate/textures
@mkdir -p $(OBJS_DIR_B)srcs_bonus/displaying
@mkdir -p $(OBJS_DIR_B)srcs_bonus/handling
@mkdir -p $(OBJS_DIR_B)srcs_bonus/global_handling
@mkdir -p $(OBJS_DIR_B)srcs_bonus/guards
@mkdir -p $(OBJS_DIR_B)srcs_bonus/menu
@mkdir -p $(OBJS_DIR_B)srcs_bonus/editor
@mkdir -p $(OBJS_DIR_B)srcs_bonus/editor_maps
@mkdir -p $(OBJS_DIR_B)srcs_bonus/editor_menu
@$(CC) $(CC_FLAGS) -c $< -o $@
@printf "\033[2K\r${BLU}[BUILD - $(NAME_B)]${RST} '$<' $(END)"
$(NAME): $(OBJECTS_PREFIXED) maker
@$(CC) -o $(NAME) $(OBJECTS_PREFIXED) $(CC_FLAGS) $(MLB_FLAGS)
@printf "\033[2K\r\033[0;32m[END]\033[0m $(NAME)$(END)\n"
$(NAME_B): $(OBJECTS_PREFIXED_B) maker
@$(CC) -o $(NAME_B) $(OBJECTS_PREFIXED_B) $(CC_FLAGS) $(MLB_FLAGS)
@printf "\033[2K\r\033[0;32m[END]\033[0m $(NAME_B)$(END)\n"
all: $(NAME)
bonus: $(NAME_B)
maker:
@make -C mlx
@make bonus -C libft
@make -C ft_printf
clean:
@rm -rf $(OBJS_DIR)
@rm -rf $(OBJS_DIR_B)
@make clean -C libft
@make clean -C ft_printf
@echo "${GRN}[CLEAN]${RST} done"
fclean: clean
@make clean -C mlx
@make fclean -C libft
@make fclean -C ft_printf
@rm -f $(NAME)
@rm -f $(NAME_B)
@echo "${GRN}[FCLEAN]${RST} done"
re: fclean all
.PHONY: all clean fclean re