-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (81 loc) · 2.11 KB
/
Copy pathMakefile
File metadata and controls
98 lines (81 loc) · 2.11 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
NAME := fdf
LIBFT := libft
LIBX := minilibx-linux
CC := cc
CFLAGS := -Wall -Werror -Wextra -fPIE -O3 -flto
# -g3 -fsanitize=address
LIBS := -L$(LIBFT) -lft -L$(LIBX) -lmlx -lX11 -lXext -lm
BUILD_DIR := build
SRCS := src/swap_utils.c \
src/clip.c \
src/color_utils.c \
src/color_utils2.c \
src/free.c \
src/hooks.c \
src/initial_view.c \
src/line.c \
src/parser.c \
src/renderer.c \
src/sort_points.c \
src/transform.c \
src/utils.c \
src/vec_point.c \
src/vec_sort_point.c \
src/main.c
BONUS_SRCS := bonus/swap_utils.c \
bonus/clip.c \
bonus/color_utils.c \
bonus/color_utils2.c \
bonus/free.c \
bonus/hooks.c \
bonus/initial_view.c \
bonus/line.c \
bonus/parser.c \
bonus/renderer.c \
bonus/sort_points.c \
bonus/transform.c \
bonus/utils.c \
bonus/vec_point.c \
bonus/vec_sort_point.c \
bonus/main_bonus.c
BONUS_HEADERS := bonus/vec_point.h \
bonus/vec_sort_point.h \
bonus/fdf.h
HEADERS := src/vec_point.h \
src/vec_sort_point.h \
src/fdf.h
OBJS := ${SRCS:%.c=build/%.o}
BONUS_OBJS := ${BONUS_SRCS:%.c=build/%.o}
all: $(NAME)
$(NAME): normal_indicator $(LIBFT)/libft.a $(LIBX)/libmlx.a $(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(NAME)
normal_indicator:
touch normal_indicator
rm -f bonus_indicator
bonus_indicator: $(LIBFT)/libft.a $(LIBX)/libmlx.a $(BONUS_OBJS)
rm -f normal_indicator
touch bonus_indicator
$(CC) $(CFLAGS) $(BONUS_OBJS) $(LIBS) -o $(NAME)
$(LIBFT)/libft.a:
make -C $(LIBFT)
$(LIBX)/libmlx.a:
make -C $(LIBX)
${BUILD_DIR}/%.o: %.c ${HEADERES} ${BONUS_HEADERS} Makefile
@mkdir -p build/$$(dirname $<)
${CC} ${CFLAGS} -c $< -o $@
.PHONY=fclean
fclean: clean
make -C $(LIBFT) fclean
rm -rf $(NAME)
.PHONY=clean
clean:
make -C $(LIBFT) fclean
rm -rf $(BUILD_DIR)
rm -rf normal_indicator
rm -rf bonus_indicator
make -C $(LIBX) clean
.PHONY=re
re:: fclean
re:: all
.PHONY=bonus
bonus: bonus_indicator