-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (66 loc) · 2.68 KB
/
Makefile
File metadata and controls
88 lines (66 loc) · 2.68 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yeonhkim <yeonhkim@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/05 02:56:10 by yeonhkim #+# #+# #
# Updated: 2023/01/22 19:23:29 by yeonhkim ### ########.fr #
# #
# **************************************************************************** #
.DEFAULT_GOAL = all
CC = cc
# CFLAGS = -Wall -Wextra -Werror
CPPFLAGS = -I./lib/libft -I./lib/mlx -I./$(FDF_PATH)/includes
LDFLAGS = -L./lib/libft -L./lib/mlx -framework OpenGL -framework AppKit
LDLIBS = -lft -lmlx
# ********************************** LIBRARY ********************************* #
include config/library.mk
# ************************************ FDF *********************************** #
FDF = fdf
ifdef BONUS
FDF_PATH = ./bonus
SUFFIX = _bonus
else
FDF_PATH = ./mandatory
SUFFIX =
endif
include config/fdf_srcs.mk
FDF_OBJS = $(addprefix $(FDF_PATH)/srcs/, $(FDF_SRCS:.c=$(SUFFIX).o))
$(FDF): $(FDF_OBJS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) $^ -o $@
# ********************************* MAKE RULES ******************************* #
# **************************************************************************** #
all:
make -C $(MLX_PATH) --silent
make -C $(LIBFT_PATH) --silent
make $(FDF)
bonus:
make -C $(LIBFT_PATH) --silent
make -C $(LIBFT_PATH) --silent
BONUS=1 make $(FDF)
clean:
make -C $(LIBFT_PATH) clean --silent
make -C $(MLX_PATH) clean --silent
rm -f $(addprefix ./mandatory/srcs/, $(FDF_SRCS:.c=.o))
rm -f $(addprefix ./bonus/srcs/, $(FDF_SRCS:.c=_bonus.o))
fclean:
make -C $(LIBFT_PATH) fclean --silent
make -C $(MLX_PATH) clean --silent
rm -f $(MLX_PATH)/$(MLX)
rm -f $(addprefix ./mandatory/srcs/, $(FDF_SRCS:.c=.o))
rm -f $(addprefix ./bonus/srcs/, $(FDF_SRCS:.c=_bonus.o))
rm -f $(FDF)
re:
make fclean
make all
# ******************************* TEST RULES ********************************* #
test1:
./$(FDF) ./test_maps/42.fdf
test2:
./$(FDF) ./test_maps/elem-fract.fdf
test3:
./$(FDF) ./test_maps/julia.fdf
# **************************************************************************** #
.PHONY: all clean fclean re bonus test1 test2 test3