forked from MarkosComK/42-Printf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (58 loc) · 2.17 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
RED = $(shell printf "\33[31m")
GREEN = $(shell printf "\33[32m")
WHITE = $(shell printf "\33[37m")
YELLOW = $(shell printf "\33[33m")
RESET = $(shell printf "\33[0m")
BLUE = $(shell printf "\33[34m")
PURPLE = $(shell printf "\33[35m")
TITLE = $(shell printf "\33[32;40m")
NAME = libftprintf.a
FLAGS = -Wall -Wextra -Werror
SRCS = ft_printf.c ./srcs/putcharf.c ./srcs/putstrf.c\
./srcs/print_ptr.c ./srcs/print_ptr_hex.c\
./srcs/ptr_len.c ./srcs/print_decimal.c ./srcs/print_unsigned_dec.c\
./srcs/print_dec_width2.c ./srcs/numlen.c ./srcs/print_dec_wz.c\
./srcs/print_dec_wp2.c ./srcs/print_hexa.c
OBJS = $(SRCS:.c=.o)
LIBFT = ./libft/libft.a
all: $(NAME) libft
$(NAME): $(LIBFT) $(OBJS)
@cp $(LIBFT) $(NAME)
@ar rcs $(NAME) $(OBJS)
.c.o:
@cc $(FLAGS) -c $< -o $@
$(LIBFT):
@make --silent -C ./libft
@echo "$(PURPLE)██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗"
@echo "██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝"
@echo "██████╔╝██████╔╝██║██╔██╗ ██║ ██║ █████╗ "
@echo "██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝ "
@echo "██║ ██║ ██║██║██║ ╚████║ ██║ ██║ "
@echo "╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ "
@echo
@echo
@echo "$(GREEN) Successfully compiled ft_printf.$(RESET)"
@echo
@echo
bonus: $(NAME)
fclean: clean
@rm -f $(NAME)
@make --silent -C ./libft fclean
@clear
@echo
@echo "$(RED)┏┓┓ ┏┓┏┓┳┓┏┓┳┓"
@echo "┃ ┃ ┣ ┣┫┃┃┣ ┃┃"
@echo "┗┛┗┛┗┛┛┗┛┗┗┛┻┛"
@echo
clean:
@rm -rf *.o
@rm -rf ./srcs/*.o
@make --silent -C ./libft clean
@clear
@echo
@echo "$(RED)┏┓┓ ┏┓┏┓┳┓┏┓┳┓"
@echo "┃ ┃ ┣ ┣┫┃┃┣ ┃┃"
@echo "┗┛┗┛┗┛┛┗┛┗┗┛┻┛"
@echo
re: fclean all
.PHONY: libft