-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (38 loc) · 1.43 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mdesalle <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/11/16 14:40:00 by mdesalle #+# #+# #
# Updated: 2021/01/25 11:59:25 by mdesalle ### ########.fr #
# #
# **************************************************************************** #
NAME = libft.a
CC = gcc
CFLAGS = -Wall -Werror -Wextra
SRC = $(wildcard src/*/*.c)
OBJ = ${SRC:.c=.o}
ccgreen = "\033[0;92m"
%.o: %.c
${CC} ${CFLAGS} -I include -c $^ -o $@
all: ${NAME}
$(NAME): ${OBJ}
ar rc ${NAME} ${OBJ}
ranlib ${NAME}
@printf $(ccgreen)
@echo "Library successfully compiled"
clean:
rm -rf $(OBJ)
@printf $(ccgreen)
@echo "Library successfully cleaned"
fclean:
rm -rf $(OBJ)
rm -rf $(NAME)
@printf $(ccgreen)
@echo "Library successfully cleaned, including the libft.a file"
fcleanre:
rm -rf $(OBJ)
rm -rf $(NAME)
re: fcleanre all