-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
55 lines (43 loc) · 1.82 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mmomeni <mmomeni@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/18 17:01:34 by mmomeni #+# #+# #
# Updated: 2024/03/29 17:58:52 by mmomeni ### ########.fr #
# #
# **************************************************************************** #
NAME= minirt
SRC_DIR= src
CFLAGS= -Wall -Wextra -Werror
GLFWFLAGS= -framework Cocoa -framework OpenGL -framework IOKit
MLXFLAGS= -L ~/.brew/cellar/glfw/3.3.8/lib -lglfw -L ./MLX42/build -lmlx42
FUNCS= $(SRC_DIR)/vector.c $(SRC_DIR)/intersect.c $(SRC_DIR)/parse.c $(SRC_DIR)/shading.c $(SRC_DIR)/utils.c $(SRC_DIR)/cylinder.c
SRCS= $(SRC_DIR)/main.c $(FUNCS)
LIBFT_DIR= libft
LIBFT= $(LIBFT_DIR)/libft.a
LIBFTFLAGS= -L$(LIBFT_DIR) -lft
all: $(NAME)
$(LIBFT):
$(MAKE) -C $(LIBFT_DIR)
$(NAME): $(LIBFT) $(SRCS)
$(CC) $(CFLAGS) $(SRCS) $(LIBFTFLAGS) $(MLXFLAGS) $(GLFWFLAGS) -o $(NAME)
clean:
$(RM) $(OBJS)
fclean: clean
$(MAKE) -C $(LIBFT_DIR) fclean
$(RM) $(NAME)
re: fclean all
brew:
curl -fsSL https://rawgit.com/kube/42homebrew/master/install.sh | zsh
mlx:
cd MLX42;\
cmake -B build;\
make -C build -j4;\
debug: CFLAGS += -fsanitize=address -g
debug: all bonus
norm:
norminette $(SRCS) $(LIBFT_DIR)
.PHONY: all clean fclean re bonus brew mlx