-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (57 loc) · 2.17 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: nomoulin <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/01 15:35:58 by nomoulin #+# #+# #
# Updated: 2023/02/06 18:09:13 by nomoulin ### ########.fr #
# #
# **************************************************************************** #
CFILES = render fractol complex mendelbrot julia main configuration \
lines_rendering rendering routines sugar transforms events \
colorevents event
SRCS = $(addsuffix .c, $(CFILES))
OBJS_FILES = $(addsuffix .o, $(CFILES))
CODE_DIR = code
SRCS_DIR = $(CODE_DIR)/srcs
OBJS_DIR = $(CODE_DIR)/objs
SRCS_PATHS = $(addprefix $(SRCS_DIR)/, $(SRCS))
OBJS = $(addprefix $(OBJS_DIR)/, $(OBJS_FILES))
MLX_PATH = $(CODE_DIR)/minilibx-linux
LIBFT_PATH = $(CODE_DIR)/libft
CC = clang
CFLAGS = -Wall -Wextra -Werror
MLINKS = -I $(MLX_PATH) -L $(MLX_PATH) -lmlx -lXext -lX11 -lm
LINKSFT = -I $(LIBFT_PATH) -L $(LIBFT_PATH) -lft
MLX = $(MLX_PATH)/libmlx.a
LIBFT = $(LIBFT_PATH)/libft.a
NAME = fract-ol
all : $(NAME)
$(NAME): $(LIBFT) $(MLX) $(OBJS_DIR) $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LINKSFT) $(MLINKS) -o $(NAME)
$(OBJS):
@make $(OBJS_FILES)
%.o : $(SRCS_DIR)/%.c
$(CC) -c $< $(CFLAGS) -o $(OBJS_DIR)/$@
$(OBJS_DIR):
@mkdir $(OBJS_DIR)
$(LIBFT):
@make -C $(LIBFT_PATH)
$(MLX):
@make -C $(MLX_PATH)
clean :
@rm -rf $(OBJS_DIR)
@make clean -C $(LIBFT_PATH)
@make clean -C $(MLX_PATH)
fclean : clean
@rm -f $(NAME)
@make fclean -C $(LIBFT_PATH)
@make fclean -C $(MLX_PATH)
re : fclean all
norminette :
@norminette code/srcs
@norminette code/libft
@norminette code/*.h
.PHONY : all clean fclean re norminette