-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (62 loc) · 2.29 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: selbakya <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/01/18 14:04:13 by selbakya #+# #+# #
# Updated: 2023/02/24 16:21:52 by selbakya ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
LIBFTD = libft/
LIBFT := ${addprefix ${LIBFTD},libft.a}
LIBFTMK = make -C $(LIBFTD)
CC = cc
CFLAGS = -Wall -Wextra -Werror
SOURCE = ft_printf.c utilc.c
HEADER = ft_printf.h
OBJECT = $(SOURCE:.c=.o)
#Colors
DEF_COLOR = \033[0;39m
GRAY = \033[0;90m
RED = \033[0;91m
GREEN = \033[0;92m
YELLOW = \033[0;93m
BLUE1 = \033[0;94m
MAGENTA = \033[0;95m
CYAN = \033[0;96m
WHITE = \033[0;97m
BLUE = \033[1;36m
PINK = \033[1;35m
RESET = \033[0m
.PHONY: all clean fclean re
all : $(NAME)
$(NAME) : $(OBJECT) $(LIBFT)
@cp $(LIBFT) $(NAME)
@ar rc $(NAME) $(OBJECT) $?
@echo "$(BLUE1) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
@echo "\n$(BLUE1) libftprintf created \n$(RESET)"
@echo "$(BLUE1) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
$(LIBFT):
$(LIBFTMK)
clean:
@rm -rf $(OBJECT)
@$(LIBFTMK) clean
@echo "$(GREEN) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
@echo
@echo "$(NAME): $(GREEN) object files were deleted $(RESET)"
@echo
@echo "$(GREEN) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
fclean: clean
@rm -rf $(NAME)
@$(LIBFTMK) fclean
@echo "$(GREEN) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
@echo
@echo "$(NAME):$(GREEN) deleted $(RESET)"
@echo
@echo "$(GREEN) ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~ ~~~\n$(RESET)\c"
re:
@$(MAKE) fclean
@$(MAKE) all