-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
109 lines (92 loc) · 2.16 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
NAME = cub3d
CC = cc
FLAGS = -Wall -Wextra -Werror -g
RM = rm -rf
ALL_LIBS = -L libft/ -lft -L minilibx-linux/ -lmlx -lm -lX11 -lXext
OBJDIR = .objFiles
FILES = main \
init \
free \
free2 \
raycast \
parse_input \
parse_input1 \
parse_input2 \
check_validity \
check_validity1 \
check_validity2 \
raycast_limits \
raycast_init \
raycast_pixel \
raycast_set \
raycast_math \
raycast_move \
raycast_wall_collision \
raycast_minimap \
raycast_minimap_player \
raycast_img_loading \
raycast_sprite \
raycast_sprite2 \
raycast_sprite_special \
raycast_fps \
raycast_health \
raycast_move_sprites \
raycast_move_sprites3 \
raycast_win \
raycast_utils \
raycast_sort \
SRC = $(FILES:=.c)
OBJ = $(addprefix $(OBJDIR)/, $(FILES:=.o))
#Colors:
GREEN = \e[92;5;118m
YELLOW = \e[93;5;226m
GRAY = \e[33;2;37m
RESET = \e[0m
CURSIVE = \e[33;3m
.PHONY: all clean fclean re val run
all: $(NAME)
$(NAME): $(OBJ)
$(MAKE) all -C ./libft
@$(CC) $(OBJ) $(ALL_LIBS) -o $(NAME) libft/libft.a
@printf "$(_SUCCESS) $(GREEN)- Executable ready.\n$(RESET)"
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(CC) $(FLAGS) -c $< -o $@
clean:
@$(RM) $(OBJDIR) $(OBJ)
@$(RM) valgrind-out.txt
$(MAKE) clean -C ./libft
@printf "$(YELLOW) - Object files removed.$(RESET)\n"
fclean: clean
@$(RM) $(NAME)
@$(RM) valgrind-out.txt
$(MAKE) fclean -C ./libft
@printf "$(YELLOW) - Executable removed.$(RESET)\n"
re: fclean all
val: all
make -C ./ clean
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./$(NAME) maps/map1.cub
code valgrind-out.txt
valf: all
make -C ./ clean
./$(NAME) maps/map1.cub
code valgrind-out.txt
supp: all
make -C ./ clean
valgrind --memcheck:leak-check=full \
--show-reachable=yes \
--suppressions=/nfs/homes/mkoller/PROJECTS/Cub3d/flows_like_water/minimal.supp \
--log-file=valgrind-out.txt \
./$(NAME) maps/map1.cub
code valgrind-out.txt
run:
./$(NAME) maps/map1.cub
small:
./$(NAME) maps/map_small.cub
fail:
./$(NAME) maps/map_fail.cub