-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (84 loc) · 2.63 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jmousset <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/10/17 15:35:26 by jmousset #+# #+# #
# Updated: 2019/12/14 21:15:47 by jmousset ### ########.fr #
# Updated: 2019/12/12 20:01:25 by jmousset ### ########.fr #
# #
# **************************************************************************** #
RED = \033[31m
GREEN = \033[32m
YELLOW = \033[33m
RESET = \033[0m
NAME = wolf3d
FLAGS = -Wall -Wextra -Werror
MLX_FLAGS = -lmlx -framework OpenGL -framework AppKit
MLX_PATH = ./minilibx/
LIB_PATH = ./libft/
LIB = ./libft/libft.a
HDR_PATH = ./inc
HDR_NAME = *.h
HDR = $(addprefix $(HDR_PATH)/,$(HDR_NAME))
SRC_PATH = ./src
SRC_NAME = main.c\
wolf3d.c\
set_values.c\
parsing.c\
parsing_2.c\
ray_casting.c\
draw.c\
floor_and_ceiling.c\
controls.c\
controls_2.c\
misc.c\
misc2.c\
text_gui.c\
gui.c\
menu.c\
mouse.c\
minimap.c\
compass.c\
load_textures.c\
load_sprites.c\
draw_sky.c\
sprites.c\
create_threads.c\
items.c\
items2.c\
gain_item.c\
end_game.c
SRC = $(addprefix $(SRC_PATH)/,$(SRC_NAME))
OBJ_PATH = ./obj
OBJ_NAME = $(SRC_NAME:.c=.o)
OBJ = $(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
DEP_NAME = $(SRC_NAME:.c=.d)
all: mkdir $(NAME)
mkdir:
@mkdir -p $(OBJ_PATH)
$(NAME): $(LIB) $(OBJ) Makefile $(HDR)
@gcc $(FLAGS) $(OBJ) -o $(NAME) $(LIB) -L $(MLX_PATH) $(MLX_FLAGS)
@echo "$(YELLOW)./$(NAME) $(GREEN)ready ✅ $(RESET)"
-include $(DEP)
$(OBJ_PATH)/%.o : $(SRC_PATH)/%.c Makefile $(HDR)
@gcc $(FLAGS) -I $(LIB_PATH) -MMD -MP -c $< -o $@
$(LIB) : force
@make -C $(LIB_PATH)
force :
clean:
@rm -f $(OBJ)
@echo "$(YELLOW).o $(RED)deleted 💯 $(RESET)"
@rm -f $(DEP)
@echo "$(YELLOW).d $(RED)deleted 💯 $(RESET)"
@rm -rf $(OBJ_PATH)
@make clean -C $(LIB_PATH)
fclean: clean
@rm -f $(NAME)
@make fclean -C $(LIB_PATH)
@echo "$(YELLOW)./$(NAME) $(RED)deleted 💯 $(RESET)"
re: fclean all
.SILENT:
.PHONY: all mkdir force clean fclean re