-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (68 loc) · 3.25 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: belguabd <belguabd@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/12 16:26:12 by belguabd #+# #+# #
# Updated: 2024/02/24 05:26:30 by belguabd ### ########.fr #
# #
# **************************************************************************** #
CC = cc
CFLAGS = -Wall -Wextra -Werror
#------Folder------#
GET_NEXT_LINE = get_next_line
UTILS = utils
PARSING = parsing
NAME = so_long
NAME_BONUS = so_long_bonus
BONUS=bonus
RM = rm -f
#------Sources------#
SRC = ./mandatory/so_long.c ./mandatory/so_long_utils.c \
./mandatory/$(GET_NEXT_LINE)/get_next_line.c ./mandatory/$(GET_NEXT_LINE)/get_next_line_utils.c \
./mandatory/$(PARSING)/parsing.c ./mandatory/$(PARSING)/parsing_utils.c\
./mandatory/$(UTILS)/ft_putstr_fd.c ./mandatory/$(UTILS)/flood_fill.c ./mandatory/$(UTILS)/set_width_height.c ./mandatory/$(UTILS)/ft_set_map.c\
./mandatory/$(UTILS)/render_map.c ./mandatory/$(UTILS)/initialize_data.c ./mandatory/$(UTILS)/close_window.c ./mandatory/$(UTILS)/ft_itoa.c ./mandatory/$(UTILS)/ft_free.c
SRC_B = $(BONUS)/so_long_bonus.c $(BONUS)/animation_bonus.c $(BONUS)/animation_utils_bonus.c\
$(BONUS)/$(GET_NEXT_LINE)/get_next_line_bonus.c $(BONUS)/$(GET_NEXT_LINE)/get_next_line_utils_bonus.c \
$(BONUS)/$(PARSING)/parsing_bonus.c $(BONUS)/$(PARSING)/parsing_utils_bonus.c\
$(BONUS)/$(UTILS)/ft_putstr_fd_bonus.c $(BONUS)/$(UTILS)/flood_fill_bonus.c $(BONUS)/$(UTILS)/set_width_height_bonus.c $(BONUS)/$(UTILS)/ft_set_map_bonus.c\
$(BONUS)/$(UTILS)/render_map_bonus.c $(BONUS)/$(UTILS)/initialize_data_bonus.c $(BONUS)/$(UTILS)/close_window_bonus.c $(BONUS)/$(UTILS)/ft_itoa_bonus.c $(BONUS)/$(UTILS)/ft_free_bonus.c
#------Objects------#
OBJ = $(SRC:.c=.o)
OBJB = $(SRC_B:.c=.o)
#------Colors------#
GREEN = \033[34m
RED = \033[31m
all : $(NAME)
#------Rules------#
$(NAME): $(OBJ)
@$(CC) $(CFLAGS) $(OBJ) -lmlx -framework OpenGL -framework AppKit -o $(NAME)
@echo "$(GREEN)Run './$(NAME)' to execute"
#------Bonus------#
bonus: $(NAME_BONUS)
$(NAME_BONUS) : $(OBJB)
@$(CC) $(CFLAGS) $(OBJB) -lmlx -framework OpenGL -framework AppKit -o $(NAME_BONUS)
@echo "$(GREEN)Run './$(NAME_BONUS)' to execute"
#------Compilation------#
$(BONUS)/%.o: $(BONUS)/%.c $(BONUS)/so_long_bonus.h
@$(CC) $(CFLAGS) -c $< -o $@
mandatory/%.o: mandatory/%.c mandatory/so_long.h
@$(CC) $(CFLAGS) -c $< -o $@
#------Clean------#
clean:
@$(RM) $(OBJ)
@$(RM) $(OBJB)
@echo "$(RED)Objects removed : \033[1;31mOK\033[m"
#------fclean------#
fclean: clean
@$(RM) $(NAME)
@$(RM) $(NAME_BONUS)
@echo "$(RED)Program removed : \033[1;31mOK\033[m"
#------re------#
re: fclean all bonus
@echo "$(GREEN)Program recompiled : \033[1;34mOK\033[m"
#------.PHONY------#
.PHONY:clean