-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (37 loc) · 905 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
NAME := fractol
CFLAGS := -Werror -Wall -Wextra
INC=/usr/include
INCLIB=$(INC)/../lib
MLX_PATH := ./minilibx-linux
MLX_LIB := -L$(MLX_PATH) -lmlx
FILES := main.c \
canvas_utils.c \
color_utils.c \
generic_utils.c \
mlx_key_hooks.c \
mlx_mouse_hooks.c \
plot_fractal.c
OBJDIR := objs
SRCDIR := srcs
SRCS := $(addprefix $(SRCDIR)/, $(FILES))
OBJS := $(addprefix $(OBJDIR)/, $(FILES:.c=.o))
INCLUDES := includes
all: $(NAME)
$(NAME): $(MLX_PATH) $(OBJDIR) $(OBJS)
$(CC) -o $(NAME) $(OBJS) $(MLX_LIB) -L$(INCLIB) -lXext -lX11 -lm -lbsd
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -I$(INCLUDES) -c $< -o $@
$(MLX_PATH):
git clone https://github.com/42Paris/minilibx-linux.git $(MLX_PATH)
make -C $(MLX_PATH)
$(OBJDIR):
mkdir -p $@
clean:
${RM} ${OBJS}
fclean: clean
${RM} ${NAME}
re: fclean all
norm:
norminette $(SRCS)
norminette $(INCLUDES)
.PHONY: all clean fclean re