-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (67 loc) · 2.3 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lejimene <lejimene@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/07 17:14:16 by lejimene #+# #+# #
# Updated: 2024/01/25 18:46:18 by emollebr ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -g -Wall -Wextra -Werror
CFILES = $(SRC)/main.c \
$(SRC)/image.c \
$(SRC)/doors.c \
$(SRC)/sprites.c \
$(SRC)/parse_cub_file.c \
$(SRC)/parse_map.c \
$(SRC)/utils_parse_map.c \
$(SRC)/utils_parse_map_2.c \
$(SRC)/parse_textures.c \
$(SRC)/minimap.c \
$(SRC)/cast_rays.c \
$(SRC)/draw.c \
$(SRC)/key_events.c \
$(SRC)/utils_textures.c \
$(SRC)/utils_minimap.c \
$(SRC)/utils_colors.c \
$(SRC)/sprites_utils.c \
$(SRC)/player_move.c \
$(SRC)/initialize_params.c \
$(SRC)/draw_doors.c
OFILES = $(CFILES:.c=.o)
NAME = cub3d
SRC = ./srcs
LIB = cub3d.a
HPATH = includes
MLXFLAGS = -I ./includes/ -I ./mlx -I./libft -L./libft
LINUXFLAGS = -lXext -lX11 -lm
MACFLAGS = -Lmlx -lmlx -framework OpenGL -framework AppKit
MLX_PATH = mlx/
MLX_NAME = libmlx.a
MLX = $(MLX_PATH)$(MLX_NAME)
LIBFT = ./libft/libft.a
all : $(NAME)
$(NAME) : $(OFILES)
@${CC} $^ -o $@ $(LIBFT) $(MLX) ${MLXFLAGS} ${LINUXFLAGS}
@ar -r $(LIB) $(OFILES)
$(MAC) : $(OFILES)
@${CC} $^ -o $@ $(LIBFT) $(MLX) ${MLXFLAGS} ${MACFLAGS}
@ar -r $(LIB) $(OFILES)
$(SRC)/%.o: $(SRC)/%.c $(HPATH)/%.h
@$(CC) $(CFLAGS) -c $< -o $@
clean :
@rm -rf ${OFILES}
fclean : clean
@rm ${NAME} $(LIB)
re : fclean all
linux :
git clone git@github.com:42Paris/minilibx-linux.git mlx
make -C mlx && make -C libft
$(NAME)
mac :
git clone git@github.com:dannywillems/minilibx-mac-osx.git mlx
make -C mlx && make -C libft
$(MAC)