-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (67 loc) · 2.43 KB
/
Copy pathMakefile
File metadata and controls
85 lines (67 loc) · 2.43 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: msassaro <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/11/24 18:12:18 by msassaro #+# #+# #
# Updated: 2015/12/29 18:21:09 by msassaro ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
INCLUDE = includes/
CFLAGS = -Wall -Werror -Wextra
CC = gcc
SRCS = \
ft_printf.c\
ft_printf_bracket.c\
ft_printf_detect.c\
ft_printf_flag.c\
ft_printf_format_cdbpercent.c\
ft_printf_format_oxup.c\
ft_printf_format_parse.c\
ft_printf_format_s.c\
ft_printf_format_s_2.c\
ft_printf_stringarg.c\
ft_printf_wchar.c\
ft_printf_wchar_2.c\
SRCDIR = ./srcs/
SRC = $(addprefix $(SRCDIR), $(SRCS))
OBJS = $(SRC:.c=.o)
LIB = ar rc
################################################################################
BLUE = \033[0;34m
LIGHTBLUE = \033[0;36m
GREEN = \033[1;32m
RED = \033[1;31m
EOC = \033[0m
YELLOW = \033[33m
WHITE = \033[97m
BG_BLUE = \033[44m
ABOVE = \033[A # print on the line above
ERASE = \033[2K # erase the line and go to next line
NAMING = $(BLUE)[ $(NAME) ] ▶
################################################################################
all: $(NAME)
$(NAME):$(OBJS)
@echo "$(NAMING)Compile $(GREEN)✔$(EOC)"
@$(LIB) $(NAME) $(OBJS)
@ranlib $(NAME)
@echo "$(NAMING)$(GREEN)LIBFTPRINTF DONE ✔$(EOC)"
%.o: %.c
@echo "$(NAMING)Compile $(LIGHTBLUE) $< $(ABOVE)"
@$(CC) $(CFLAGS) -I$(INCLUDE) -o $@ -c $<
@echo "$(NAMING)Compile"
@echo "$(ABOVE) $(ERASE) $(ABOVE)"
clean:
@/bin/rm -rf $(OBJS)
@echo "$(NAMING)Clean $(GREEN)✔$(EOC)"
fclean: clean
@/bin/rm -rf $(NAME)
@echo "$(NAMING)Fclean $(GREEN)✔$(EOC)"
re: fclean all
#.SILENT = everything is silent
#.SILENT :
#.PHONY = to be sure make will run in case a filename = rule
.PHONY: clean fclean re