forked from hidaehyunlee/Libft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
96 lines (81 loc) · 2.16 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: daelee <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/03/09 18:24:09 by daelee #+# #+# #
# Updated: 2021/01/03 12:23:27 by daelee ### ########.fr #
# #
# **************************************************************************** #
NAME = libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
AR = ar rcs
RM = rm -f
FILES = ft_memset \
ft_bzero \
ft_memcpy \
ft_memccpy \
ft_memmove \
ft_memchr \
ft_memcmp \
ft_strlen \
ft_strlcpy \
ft_strlcat \
ft_strchr \
ft_strrchr \
ft_strnstr \
ft_strncmp \
ft_atoi \
ft_isalpha \
ft_isdigit \
ft_isalnum \
ft_isascii \
ft_isprint \
ft_toupper \
ft_tolower \
ft_calloc \
ft_strdup \
ft_substr \
ft_strjoin \
ft_strtrim \
ft_split \
ft_itoa \
ft_strmapi \
ft_putchar_fd \
ft_putstr_fd \
ft_putendl_fd \
ft_putnbr_fd \
ft_strtok \
ft_strcmp \
get_next_line \
FILES_B = ft_lstnew \
ft_lstadd_front \
ft_lstsize \
ft_lstlast \
ft_lstadd_back \
ft_lstdelone \
ft_lstclear \
ft_lstiter \
ft_lstmap
SRCS_DIR = ./
SRCS = $(addprefix $(SRCS_DIR), $(addsuffix .c, $(FILES)))
SRCS_B = $(addprefix $(SRCS_DIR), $(addsuffix .c, $(FILES_B)))
OBJS_DIR = ./
OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(FILES)))
OBJS_B = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(FILES_B)))
.c.o: $(SRCS)
$(CC) $(CFLAGS) -c -o $@ $<
$(NAME): $(OBJS)
$(AR) $@ $^
bonus: $(OBJS_B)
$(AR) $(NAME) $^
all: $(NAME)
clean:
$(RM) $(OBJS) $(OBJS_B)
fclean: clean
$(RM) $(NAME)
re: clean all
.PHONY: bonus all clean fclean re