-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
101 lines (77 loc) · 2.33 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vrybalko <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/23 14:08:11 by vrybalko #+# #+# #
# Updated: 2017/10/20 22:26:22 by vrybalko ### ########.fr #
# #
# **************************************************************************** #
NAME = wolf3d
IDIR = includes/
VPATH = src:includes
BIN_DIR = bin/
MLX_DIR = minilibx/
MLX_DIR_MAC = minilibx_macos/
FLAGS = -Wall -Wextra -Werror -I$(IDIR) -g
ifeq ($(shell uname -s),Linux)
FLAGS += -fopenmp
FLAGS_MLX = -lmlx -lXext -lX11 -lm -fopenmp
MLX_DIR = minilibx/
else
FLAGS_MLX = -lmlx -framework OpenGl -framework AppKit
MLX_DIR = minilibx_macos/
endif
LIB = libft/libft.a $(MLX_DIR)/libmlx.a
SRCS = main.c \
ft_img_px_put.c \
ft_mlx_events.c \
ft_mlx_init.c \
ft_mlx_init1.c \
ft_draw_line.c \
ft_mlx_helpers.c \
ft_mlx_helpers1.c \
ft_hooks.c \
ft_read_map.c \
ft_raycast.c \
ft_load_tex.c \
ft_textures.c \
ft_sprites.c \
ft_shades.c \
ft_doors.c \
ft_enemies.c \
ft_put_info.c \
ft_put_info1.c \
ft_menu.c \
ft_game_mode_hooks.c \
ft_shoot.c \
ft_load_gif.c \
ft_pickups.c
BINS = $(addprefix $(BIN_DIR), $(SRCS:.c=.o))
all: lib $(NAME)
lib:
make -C $(MLX_DIR)
make -C libft/
libclean:
make -C $(MLX_DIR) clean
make -C libft/ clean
libfclean:
make -C libft/ fclean
$(NAME): $(BINS)
gcc -o $(NAME) $(BINS) $(FLAGS) $(FLAGS_MLX) $(LIB) -L $(MLX_DIR) \
-I $(MLX_DIR)
$(BIN_DIR)%.o: %.c
gcc $(FLAGS) -c -o $@ $<
clean: libclean
/bin/rm -f $(BINS)
fclean: libfclean clean
/bin/rm -f $(NAME)
re: fclean all
f: all
./$(NAME) res/test.map
fast_re:
/bin/rm -f $(BINS)
/bin/rm -f $(NAME)
fre: fast_re all