-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.76 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tedelin <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/04/25 16:28:04 by mcatal-d #+# #+# #
# Updated: 2023/06/01 22:32:23 by tedelin ### ########.fr #
# #
# **************************************************************************** #
NAME = cub3D
INCLUDE = -I./include -I./libft -I./mlx
CC = cc
CFLAGS = -Wall -Wextra -Werror
HEADERS = include/cub3d.h mlx/mlx.h mlx/mlx_int.h libft/libft.h
SRCS = $(addprefix src/, main.c \
$(addprefix parsing/, file_to_char.c set_struct_map.c free.c \
verif_good_map.c check_player.c utils_parsing.c verif_rgb.c) \
$(addprefix raycasting/, raycasting.c moves.c utils.c keys.c))
OBJS = $(patsubst src/%.c, obj/%.o, $(SRCS))
RM = rm -rf
LIBFT = -Llibft -lft
MLX_FLAGS = -Lmlx -lmlx -lX11 -lXext
all: $(NAME)
$(NAME): $(OBJS)
make -C libft
make -C mlx
$(CC) $(CFLAGS) $(INCLUDE) -o $(NAME) $(OBJS) $(MLX_FLAGS) $(LIBFT) -lm
obj/%.o: src/%.c $(HEADERS)
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(INCLUDE) -c -o $@ $<
clean:
make -C mlx clean
make -C libft clean
$(RM) $(OBJS)
$(RM) obj
fclean: clean
make -C libft fclean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re