-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (49 loc) · 1.34 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
NAME = libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
AR = ar rc
ARX = ar x
RM = rm -f
RANLIB = ranlib
FT_LIB_DIR = ft_lib/
FT_LIB = $(FT_LIB_DIR)ft_lib.a
PRINTF_DIR = ft_printf/
PRINTF = $(PRINTF_DIR)ft_printf.a
GNL_DIR = get_next_line/
GNL = $(GNL_DIR)gnl.a
all: $(NAME)
$(FT_LIB):
@echo "\n\n\033[0;34mCompiling ft_lib..."
@make -C $(FT_LIB_DIR) --no-print-directory
$(PRINTF):
@echo "\033[0;34mCompiling ft_printf..."
@make -C $(PRINTF_DIR) --no-print-directory
$(GNL):
@echo "\033[0;34mCompiling get_next_line..."
@make -C $(GNL_DIR) --no-print-directory
$(NAME): $(FT_LIB) $(PRINTF) $(GNL)
@echo "\033[0;34mCompiling libft..."
@$(ARX) $(FT_LIB)
@$(ARX) $(PRINTF)
@$(ARX) $(GNL)
@$(AR) $(NAME) *.o
@$(RANLIB) $(NAME)
@$(RM) *.o
@$(RM) ft_lib.a
@echo "\n\033[0;32mCompiled libft!\033[0m"
clean:
@make clean -C $(FT_LIB_DIR) --no-print-directory
@make clean -C $(PRINTF_DIR) --no-print-directory
@make clean -C $(GNL_DIR) --no-print-directory
fclean: clean
@echo "\033[0;31mCleaning ft_lib..."
@make fclean -C $(FT_LIB_DIR) --no-print-directory
@echo "\033[0;31mCleaning ft_printf..."
@make fclean -C $(PRINTF_DIR) --no-print-directory
@echo "\033[0;31mCleaning get_next_line..."
@make fclean -C $(GNL_DIR) --no-print-directory
@$(RM) $(NAME)
@echo "Done !"
@echo "\033[0m"
re: fclean all
.PHONY: all clean fclean re