-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (51 loc) · 1.13 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
NAME = fractol
SRCS += main.c
SRCS += app.c
SRCS += app_utils.c
SRCS += t_double2.c
SRCS += t_double2_util.c
SRCS += multithreading.c
SRCS += config.c
SRCS += coloring.c
SRCS += thread_pool.c
SRCS += events.c
SRCS += key_event.c
SRCS += delta_draw.c
SRCS += mouse_events.c
SRCS += drawing.c
SRCS += gradient.c
SRCS += rgb.c
SRCS += gradient_definitions.c
SRCS += work_queue.c
SRCS += fractal_list.c
SRCS += julia_functions.c
SRCS += mandelbrot_functions.c
FLAGS = -Wall -Wextra -Werror
FLAGS += -O2 -march=native
OBJ_DIR = obj
OBJ_LIST = $(SRCS:.c=.o)
OBJS = $(addprefix $(OBJ_DIR)/,$(OBJ_LIST))
LIBS = -l ft -L libft
INCLUDES = -I libft/
LIBS += libmlx.a -framework OpenGL -framework AppKit
all: $(NAME)
$(NAME): $(OBJ_DIR) $(OBJS)
make -C ./libft
sh patch_mlx.sh
gcc -o $(NAME) $(OBJS) $(INCLUDES) $(LIBS)
# $^ is the dependencies of the rule
# $@ is the name of the rule
$(OBJ_DIR)/%.o : %.c
gcc $(FLAGS) $(INCLUDES) -c $^ -o $@
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
mkdir -p $(OBJ_DIR)/libft/
clean :
make clean -C ./libft
rm -rf $(OBJ_DIR)
rm -f libmlx.a
fclean : clean
make fclean -C ./libft
rm -f $(NAME)
re : fclean
make all