-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (40 loc) · 939 Bytes
/
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
NAME = cub3D
MLX = libmlx.a
SRCS = cub3d.c \
utils/*.c \
parse/*.c \
GNL/*.c \
display/*.c
CC = clang
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
RMRF = rm -rf
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
$(NAME):
@ $(MAKE) -C mlx all
@ cp ./mlx/$(MLX) .
$(CC) $(CFLAGS) -g3 -Ofast -o $(NAME) -Imlx $(SRCS) -Lmlx -lmlx -lm -framework OpenGL -framework AppKit
endif
ifeq ($(UNAME), Linux)
$(NAME):
@chmod 777 mlx_linux/configure
@ $(MAKE) -C mlx_linux all
$(CC) $(CFLAGS) -g3 -o $(NAME) $(SRCS) -Imlx_linux -Lmlx_linux -lmlx -lmlx_Linux -L/usr/lib -lXext -lX11 -lm
endif
all: $(NAME)
ifeq ($(UNAME), Darwin)
clean:
@ $(MAKE) -C mlx clean
@ $(RMRF) Cub3D.dSYM
endif
ifeq ($(UNAME), Linux)
clean:
@ $(MAKE) -C mlx_linux clean
@ $(RMRF) Cub3D.dSYM
endif
fclean: clean
@ $(RM) $(MLX)
@ $(RM) cub3D
re: fclean all
.PHONY: $(NAME) all test clean fclean re