-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
88 lines (72 loc) · 2.3 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
77
78
79
80
81
82
83
84
85
86
87
88
GREEN = \033[0;32m
YELLOW = \033[0;33m
RED = \033[0;31m
RESET = \033[0m
NAME = fdf
CFLAGS = -Wall -Wextra -Werror -Imlx #-O2
LDFLAGS = -lmlx -framework OpenGL -framework AppKit
BSRC = bonus/config_bonus.c \
bonus/draw_bonus.c \
bonus/string_bonus.c \
bonus/string2_bonus.c \
bonus/geo_bonus.c \
bonus/cartesian_bonus.c \
bonus/read_bonus.c \
bonus/error_bonus.c \
bonus/rendering_sides_bonus.c \
bonus/main_bonus.c \
bonus/events_listener_bonus.c \
bonus/events/input_bonus.c \
bonus/events/conf_bonus.c \
bonus/events/moving_bonus.c \
bonus/events/renderer_bonus.c \
bonus/events/rotation_bonus.c \
bonus/events/cmd_bonus.c
SRC = manda/config.c \
manda/draw.c \
manda/string.c \
manda/string2.c \
manda/geo.c \
manda/cartesian.c \
manda/read.c \
manda/error.c \
manda/main.c \
OBJ = $(SRC:.c=.o)
BOBJ = $(BSRC:.c=.o)
GNL = get_next_line.o
LIBFT = libft.a
FTPRINTF = libftprintf.a
all: $(NAME)
$(NAME): $(LIBFT) $(GNL) $(OBJ) $(FTPRINTF)
@echo "$(GREEN)Compiling and linking $(NAME) 🤓☁️$(RESET)"
@cc $(OBJ) $(GNL) $(LIBFT) $(FTPRINTF) -o $(NAME) $(LDFLAGS)
@echo "$(GREEN)Done! -----------------------------------------$(RESET)"
bonus: $(LIBFT) $(GNL) $(BOBJ) $(FTPRINTF)
@echo "$(GREEN)Compiling and linking bonus $(NAME)_bonus 🤓☁️$(RESET)"
@cc $(BOBJ) $(GNL) $(LIBFT) $(FTPRINTF) -o $(NAME)_bonus $(LDFLAGS)
@echo "$(GREEN)Done! -----------------------------------------$(RESET)"
OBJ: SRC
@echo "$(YELLOW)Compiling $< 🛠️$(RESET)"
@cc -c $< $(CFLAGS) -o $@
BOBJ: BSRC
@echo "$(YELLOW)Compiling bonus$< 🛠️$(RESET)"
@cc -c $< $(CFLAGS) -o $@
libft.a:
@echo "$(YELLOW)Compiling libft 🛠️$(RESET)"
@make -C ./libft && mv ./libft/libft.a .
get_next_line.o:
@echo "$(YELLOW)Compiling get_next_line 🛠️$(RESET)"
@cc -c ./get_next_line/get_next_line.c $(CFLAGS) -o get_next_line.o
libftprintf.a:
@echo "$(YELLOW)Compiling ft_printf 🛠️$(RESET)"
@make -C ./ft_printf && mv ./ft_printf/libftprintf.a .
clean:
@echo "$(RED)Removing objects and executable 🧹$(RESET)"
@make -C ./libft clean
@make -C ./ft_printf clean
@rm -f $(OBJ) $(GNL) $(LIBFT) $(FTPRINTF) $(BOBJ)
fclean: clean
@echo "$(RED)Removing executable 😢$(RESET)"
@rm -f $(NAME) $(NAME)_bonus
build: all bonus clean
re: clean all