-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (58 loc) · 2.85 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: abellakr <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/11 11:54:55 by abellakr #+# #+# #
# Updated: 2022/09/11 12:04:36 by abellakr ### ########.fr #
# #
# **************************************************************************** #
NAME = cub3D
CC = gcc
CFLAGS = -Wall -Wextra -Werror -Ofast
LIBFT_NAME = libft.a
# directions :
SOURCE = source/
RESOURCE = Resources/
INCLUDES = includes/
PARS_DIR = $(SOURCE)parsing/
LIBFT_DIR = $(RESOURCE)libft
MINILIBX_DIR = $(RESOURCE)minilibx_opengl/
MINIMAP = minimap/
FOV_RAYS = Fov_Rays/
EVENTS = events/
FRAMEWORKS = $(MINILIBX_DIR)/libmlx.a -framework AppKit -framework OpenGL
# Srcs
SRCS = $(SOURCE)main.c $(SOURCE)_error.c $(SOURCE)checkargs.c $(SOURCE)player.c $(SOURCE)Hooks_and_Events.c $(SOURCE)map.c $(SOURCE)ray_cating.c $(SOURCE)render_wall.c $(SOURCE)ft_reassign.c $(SOURCE)draw_ceilling_floor.c $(SOURCE)draw_line.c $(SOURCE)draw__fov.c $(SOURCE)wall_texture.c $(SOURCE)ray_catingUtils.c $(SOURCE)ray_catingUtils_1.c $(SOURCE)graphic.c $(SOURCE)wall_textureUtils.c
PARS_SRCS = $(PARS_DIR)parsing.c $(PARS_DIR)stock_minimap.c $(PARS_DIR)is_player.c $(PARS_DIR)check_minimap.c $(PARS_DIR)get_map_size.c $(PARS_DIR)chech_direction.c $(PARS_DIR)get_g_map.c $(PARS_DIR)parsing_minimap.c $(PARS_DIR)parsing_utils.c $(PARS_DIR)parsing_params.c $(PARS_DIR)save_params.c $(PARS_DIR)save_params2.c $(SOURCE)mouse_events.c $(SOURCE)draw_shapes.c $(SOURCE)translation.c
# Objs
OBJS = $(SRCS:.c=.o)
PARS_OBJS = $(PARS_SRCS:.c=.o)
# All Files
FILES = $(SRCS) $(PARS_SRCS) $(LIBFT_DIR)/$(LIBFT_NAME)
%.o:%.c
@${CC} $(CFLAGS) -o $@ -c $<
@printf "\x1b[36m +>\033[0m compiling \033[38;5;42m$< \033[0m\n"
all: $(NAME)
_libft :
@make bonus -C $(LIBFT_DIR)
@make -C $(MINILIBX_DIR)
$(NAME): $(OBJS) $(PARS_OBJS) _libft
@$(CC) $(CFLAGS) $(FRAMEWORKS) $(FILES) -o $(NAME) -g
@echo "\x1b[36m +> cub3D \033[0m\033[38;5;42m [Done] \033[0m";
push:fclean
@git status
@read -p "Files To Add:" files; git add "$$files"
@ read -p "Message:" message; \
git commit -m "$$message"; \
git push
clean:
@rm -rf $(OBJS) $(PARS_OBJS)
@make fclean -C $(LIBFT_DIR)/
fclean: clean
@rm -rf $(NAME) cub3D.dSYM
re : fclean all
# -fsanitize=address
# SANIT = -static-libsan -fsanitize=address