-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
104 lines (80 loc) · 2.75 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kafortin <kafortin@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/04/05 20:32:19 by kafortin #+# #+# #
# Updated: 2023/04/18 16:19:49 by kafortin ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra -Werror
NAME = so_long
MAKE_LIBFT = cd ./Libft/ && make
MAKE_MLX = cd ./Minilibx/ && make
BONUS_NAME = so_long_bonus
FILES = ./srcs/end_game_options.c \
./srcs/exit_management.c \
./srcs/flood_fill.c \
./srcs/init.c \
./srcs/moves_utils.c \
./srcs/moves.c \
./srcs/put_images.c \
./srcs/read_map.c \
./srcs/so_long.c \
./srcs/validate_map.c \
BONUS_FILES = ./srcs/bonus/end_game_options_bonus.c \
./srcs/bonus/ennemy_bonus.c \
./srcs/bonus/exit_management_bonus.c \
./srcs/bonus/flood_fill_bonus.c \
./srcs/bonus/init_bonus.c \
./srcs/bonus/moves_bonus.c \
./srcs/bonus/moves_utils_bonus.c \
./srcs/bonus/put_images_bonus.c \
./srcs/bonus/read_map_bonus.c \
./srcs/bonus/so_long_bonus.c \
./srcs/bonus/utils_bonus.c \
./srcs/bonus/validate_map_bonus.c \
OBJS = $(FILES:.c=.o)
BONUS_OBJS = $(BONUS_FILES:.c=.o)
RM = @rm -f
.SILENT: $(OBJS) $(BONUS_OBJS) $(MAKE_MLX)
all: $(NAME)
$(NAME): $(OBJS)
@$(MAKE_LIBFT)
@$(MAKE_MLX)
@echo "Compiling so_long..."
@$(CC) $(CFLAGS) $(OBJS) ./Libft/libft.a ./Minilibx/libmlx.a -framework OpenGL -framework AppKit -o $(NAME)
@echo "Completed! 🤠"
bonus: $(BONUS_NAME)
$(BONUS_NAME): $(BONUS_OBJS)
@$(MAKE_LIBFT)
@$(MAKE_MLX)
@echo "Compiling bonus..."
@$(CC) $(CFLAGS) $(BONUS_OBJS) ./Libft/libft.a ./Minilibx/libmlx.a -framework OpenGL -framework AppKit -o $(BONUS_NAME)
@echo "Completed! 🤠"
clean:
@$(MAKE) clean -C ./Libft
$(RM) $(BONUS_OBJS)
$(RM) $(OBJS)
fclean:
@$(MAKE) fclean -C ./Libft
@$(MAKE) clean -C ./Minilibx
$(RM) $(OBJS)
$(RM) $(BONUS_OBJS)
$(RM) $(NAME)
$(RM) $(BONUS_NAME)
re: fclean all
add:
git add $(FILES)
git add $(BONUS_FILES)
git add *.h
git add Makefile
commit:
git commit -m "$m"
push:
git push origin master
git: add commit push
.PHONY: all bonus clean fclean re add commit push git