-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (74 loc) · 2.36 KB
/
Makefile
File metadata and controls
89 lines (74 loc) · 2.36 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ralves-g <ralves-g@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/26 16:26:20 by ralves-g #+# #+# #
# Updated: 2025/04/10 12:54:10 by ralves-g ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g -fsanitize=address
MLXFLAGS = -lmlx -framework OpenGL -framework AppKit
MLX_LINUX = -Lmlx_linux -lmlx_Linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm -lz
RM = rm -f
NAME = so_long
NAME2 = so_long_linux
INCLUDE = -I ./
SRCS_ = \
animations.c \
errors.c \
exit.c \
exit2.c \
key_actions.c \
map_to_img.c \
map_to_img2.c \
map_to_img3.c \
move_character.c \
move_character2.c \
move_character3.c \
move_enemy.c \
move_enemy2.c \
mp_checker.c \
mp_checker2.c \
mp_checker3.c \
mp_utils.c \
objects.c \
preparations.c \
preparations2.c \
preparations3.c \
print_phrase.c \
nyan.c \
side_info.c \
so_long.c \
so_long_utils.c \
so_long_wall_utils.c \
so_long_wall_utils2.c \
so_long_wall_utils3.c \
so_long_wall_utils4.c \
get_next_line.c \
get_next_line_utils.c
SRCS = $(addprefix $(_SRC), $(SRCS_))
_OBJ = ./obj/
_SRC = ./src/
OBJS = $(patsubst $(_SRC)%.c, $(_OBJ)%.o, $(SRCS))
all: $(NAME)
$(_OBJ)%.o: $(_SRC)%.c
$(CC) -c $< -o $@
# $(NAME): $(_OBJ) $(OBJS)
# $(CC) $(CFLAGS) $(OBJS) $(MLXFLAGS) -o $(NAME) $(INCLUDE)
# linux: $(NAME2)
$(NAME): $(_OBJ) $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(MLX_LINUX) -o $(NAME) $(INCLUDE)
#bonus: $(SRCS_B) $(OBJS_B)
# $(CC) $(CFLAGS) $(SRCS_B) -o $(NAME_B)
# $(CC) $(CFLAGS) $(SRCS_B) -c
$(_OBJ):
mkdir $@
clean:
$(RM) -r $(_OBJ)
fclean: clean
$(RM) $(NAME) $(NAME2)
re: fclean all