-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
88 lines (63 loc) · 2.51 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mkaraden <mkaraden@student.42istanbul.c +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/26 16:15:07 by mkaraden #+# #+# #
# Updated: 2023/10/22 02:53:41 by mkaraden ### ########.fr #
# #
# **************************************************************************** #
#header ekle
AR = ar rcs
RM = rm -f
CC = gcc
CFLAGSA = -I ./include/ -fsanitize=address
CFLAGS = -I ./include/ -Wall -Wextra -Werror
CDEBUG = -g
FRMS = -framework OpenGL -framework AppKit
SRC_DIR = src
OBJ_DIR = obj
BIN_DIR = bin
SRC = main/main.c main/hook.c main/data_error_handler.c main/init.c main/debug.c main/utils.c main/dtoa.c \
parser/parse.c parser/string_utils.c parser/get_elements.c parser/lexer.c parser/ft_split.c parser/check_map.c parser/format_map.c parser/get_map.c parser/get_player.c parser/debug.c parser/check_inside.c parser/re_format_map.c\
raycast/raycast.c \
raycast/raycast_calculate.c raycast/raycast_draw.c raycast/raycast_utils.c \
minimap/minimap.c
OBJ = $(addprefix $(OBJ_DIR)/, $(SRC:.c=.o))
ARC = ./src/gnl/get_next_line.a mlx/libmlx.a
BIN = cub3d
NAME = $(BIN_DIR)/$(BIN)
all: $(NAME)
data: $(OBJ) | $(BIN_DIR)
@cd ./$(SRC_DIR)/gnl && $(MAKE)
@echo "Gnl is compiled."
@cd ./mlx && $(MAKE)
@$(CC) $(CFLAGSA) $(OBJ) $(ARC) $(FRMS) -o $(NAME)
@echo "cub3d data is compiled."
$(NAME): $(OBJ) | $(BIN_DIR)
@cd ./$(SRC_DIR)/gnl && $(MAKE)
@echo "Gnl is compiled."
@cd ./mlx && $(MAKE)
@$(CC) $(CFLAGS) $(OBJ) $(ARC) $(FRMS) -o $(NAME)
@echo "cub3d is compiled."
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CFLAGS) $(CDEBUG) -c $< -o $@
run: all
./$(NAME) ./maps/map3.cub
clean:
rm -f $(OBJ)
rm -f $(BOBJS)
@cd ./$(SRC_DIR)/gnl && $(MAKE) clean
@cd ./mlx && $(MAKE) clean
@echo "Cleaned"
fclean: clean
rm -f $(NAME)
rm -f $(BNAME)
@cd ./$(SRC_DIR)/gnl && $(MAKE) fclean
@cd ./mlx && $(MAKE) clean
@echo "Fully cleaned"
re: fclean
@make all
.PHONY: all clean fclean run re