-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (65 loc) · 2.07 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: ansulist <ansulist@student.42abudhabi.a +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/05 20:42:17 by juhaamid #+# #+# #
# Updated: 2024/03/07 17:47:06 by ansulist ### ########.fr #
# #
# **************************************************************************** #
NAME = cub3D
SRCS = cub3d.c \
load_map.c \
key.c \
load_map_utils.c \
load_map2.c \
load_color.c \
load_path_texture.c \
texture.c \
chcking_line.c \
raycast.c \
ray_calculation.c \
raycast_helper.c \
draw_utils.c \
get_map_to_array.c \
key_moves.c \
keyhandler.c \
get_map_to_arr_utils.c \
get_ma_array_utils2.c \
check_init.c \
GNLSRCS = ./get_next_line/get_next_line.c\
./get_next_line/get_next_line_utils.c
OBJS = ${SRCS:.c=.o}
HEADER = include
LB = ./libft/libft.a
CC = cc
OS:= ${shell uname}
ifeq (${OS},Darwin)
MLXDIR = mlx
MLXFLG = -framework OpenGL -framework Appkit
CFLAGS += -D OSX -Wall -Werror -Wextra
else
MLXDIR = mlx_linux
MLXFLG = -lXext -lX11
CFLAGS += -D LINUX
endif
.c.o:
${CC} ${CFLAGS} -c $< -o ${<:.c=.o}
all: ${LB} ${NAME} ${MLXDIR}
${NAME}: ${OBJS}
make -C $(MLXDIR)
${CC} ${CFLAGS} ${OBJS} ${GNLSRCS} -L${MLXDIR} -lmlx -march=native ${MLXFLG} ${LB} -o ${NAME} -lm
$(LB):
${MAKE} -C ./libft
# $(MLXDIR):
# ${MAKE} -C ${MLXDIR}
clean:
rm -f ${OBJS}
${MAKE} clean -C $(MLXDIR)
${MAKE} fclean -C ./libft
fclean: clean
rm -f ${NAME}
re: fclean all
.PHONY: all clean fclean re bonus