-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (25 loc) · 982 Bytes
/
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
SRC = ft_printf.c ft_printf_utils.c
OBJS = $(SRC:.c=.o)
GCC = gcc -Wall -Werror -Wextra
RM = rm -f
NAME = libftprintf.a
all: $(NAME)
$(NAME): $(OBJS)
@echo "\033[1;30m╭───────────────────────────────────╮\033[0m"
@echo "\033[1;30m│ \033[0m\033[0;32mArchive file has been created.\033[1;30m │\033[0m"
@echo "\033[1;30m╰───────────────────────────────────╯\033[0m"
@ar rcs $(NAME) $(OBJS)
%.o: %.c
@$(GCC) -I ./c -c $< -o $@
@echo "\033[0;32mObject file $@ has been created.\033[0m"
clean:
@echo "\033[0;31mObject files have been removed.\033[0m"
@$(RM) $(OBJS)
fclean:
@$(RM) $(NAME) $(OBJS)
@echo "\033[0;31m\033[1mArchive and object files have been removed.\033[0m"
re:
@$(MAKE) -s fclean > /dev/null
@$(MAKE) -s all > /dev/null
@echo "\033[0;33mFiles have been rebuilt."
.PHONY: all clean fclean re