-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
144 lines (115 loc) · 3.01 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
NAME = cub3d
NAME_B = cub3d_bonus
FLAGS = -Wall -Werror -Wextra -O3
SRCS = main/main.c \
main/main_init.c \
main/utils.c \
main/movement.c \
main/game_hooks.c \
main/rotation.c \
main/movement_utils.c \
utils/get_next_line.c \
utils/get_next_line_utils.c \
utils/dblink/dblink_utils.c \
utils/dblink/dblink.c \
parsing/verif.c \
parsing/verif_wall.c \
parsing/mapInit.c \
parsing/parsing.c \
parsing/map.c \
parsing/map_second.c \
parsing/map_third.c \
parsing/orientation.c \
parsing/resize_map.c \
parsing/parsing_utils.c \
parsing/mapInit_utils.c \
render/graphic_operator.c \
render/graphic_operator2.c \
render/raycaster.c \
render/raycaster_utils.c \
render/raycaster_utils2.c \
render/fisheye.c \
render/draw.c \
render/render_texture.c \
SRCS_B = main/main.c \
main/main_init.c \
main/utils.c \
main/movement.c \
main/rotation.c \
main/movement_utils.c \
utils/get_next_line.c \
utils/get_next_line_utils.c \
utils/dblink/dblink_utils.c \
utils/dblink/dblink.c \
parsing/verif.c \
parsing/verif_wall.c \
parsing/mapInit.c \
parsing/map_second.c \
parsing/map_third.c \
parsing/parsing.c \
parsing/map.c \
parsing/orientation.c \
parsing/resize_map.c \
parsing/parsing_utils.c \
parsing/mapInit_utils.c \
render/graphic_operator.c \
render/graphic_operator2.c \
render/raycaster.c \
render/raycaster_utils.c \
render/raycaster_utils2.c \
render/fisheye.c \
render/draw.c \
render/render_texture.c \
bonus/game_hooks_bonus.c \
bonus/render_map.c \
HEADER = ./Include/cube.h
FRAMEWORK = -framework Cocoa -framework OpenGL -framework IOKit
LIBS = ./utils/libft/libft.a ./utils/MLX/libmlx42.a ./utils/MLX/glfw/lib-x86_64/libglfw3.a
.c.o:
@gcc ${FLAGS} -c $< -o ${<:.c=.o}
OBJS = ${SRCS:.c=.o}
OBJS_B = ${SRCS_B:.c=.o}
MAP = ./map/valid_map1.cub
CC = gcc
OS := $(shell uname -s)
all: ${NAME}
${NAME}:${OBJS}
@$(MAKE) -C ./utils/libft
@$(MAKE) -s -C ./utils/MLX
ifeq ($(OS),Darwin)
@${CC} ${FLAGS} ${OBJS} ${LIBS} ${FRAMEWORK} -o ${NAME}
endif
ifeq ($(OS),Linux)
@${CC} ${FLAGS} ${OBJS} ./utils/MLX/libmlx42.a ./utils/libft/libft.a -lglfw -lm -o ${NAME}
endif
clean:
@${RM} ${OBJS}
@${RM} ${OBJS_B}
fclean: clean
make -C ./utils/libft clean
rm -rf cub3d
rm -rf cub3d_bonus
git:
@git add ${SRCS} ${HEADER} Makefile
val:
valgrind --track-origins=yes --leak-check=full ./$(NAME) ./map/valid_map1.cub
run: all
./${NAME} ./map/valid_map.cub
@cat ./map/valid_map.cub
norm:
norminette ${SRCS}
bun: all
leak: all
@echo "\033[92mTEST 1 \n \033[0m"
@leaks --atExit -- ./${NAME} ./map/valid_map1.cub
bonus: ${OBJS_B}
@$(MAKE) -C ./utils/libft
@$(MAKE) -s -C ./utils/MLX
ifeq ($(OS),Darwin)
@${CC} ${FLAGS} ${OBJS_B} ${LIBS} ${FRAMEWORK} -o ${NAME_B}
endif
ifeq ($(OS),Linux)
@${CC} ${FLAGS} ${OBJS} ./utils/MLX/libmlx42.a ./utils/libft/libft.a -lglfw -lm -o ${NAME_B}
endif
re: fclean all
.PHONY: clean fclean re all