-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (93 loc) · 2.22 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
97
98
99
100
101
102
103
104
105
CC = cc
CFLAGS = -Wall -Wextra -Werror
DIR = srcs/
NAME = libft.a
SRC = ./core/ft_isalnum.c \
./core/ft_isalpha.c \
./core/ft_isascii.c \
./core/ft_isdigit.c \
./core/ft_isprint.c \
./core/ft_strlen.c \
./core/ft_memset.c \
./core/ft_bzero.c \
./core/ft_memcpy.c \
./core/ft_memmove.c \
./core/ft_strcat.c \
./core/ft_strlcat.c \
./core/ft_strlcpy.c \
./core/ft_toupper.c \
./core/ft_tolower.c \
./core/ft_memchr.c \
./core/ft_strchr.c \
./core/ft_strrchr.c \
./core/ft_memcmp.c \
./core/ft_strcmp.c \
./core/ft_strncmp.c \
./core/ft_strnstr.c \
./core/ft_atoi.c \
./core/ft_freesplit.c \
./core/ft_math.c \
./core/ft_math_abs.c \
./core/ft_atol.c \
./core/ft_calloc.c \
./core/ft_strdup.c \
./core/ft_strndup.c \
./core/ft_substr.c \
./core/ft_strtrim.c \
./core/ft_split.c \
./core/ft_itoa.c \
./core/ft_ltoa.c \
./core/ft_strmapi.c \
./core/ft_striteri.c \
./core/ft_putchar_fd.c \
./core/ft_putstr_fd.c \
./core/ft_putendl_fd.c \
./core/ft_putnbr_fd.c \
./core/ft_lstnew_bonus.c \
./core/ft_lstadd_front_bonus.c \
./core/ft_lstsize_bonus.c \
./core/ft_lstlast_bonus.c \
./core/ft_lstadd_back_bonus.c \
./core/ft_lstdelone_bonus.c \
./core/ft_lstclear_bonus.c \
./core/ft_lstiter_bonus.c \
./core/ft_lstmap_bonus.c \
./core/ft_str_is_whitespace.c \
./core/ft_atoi_base.c \
./core/ft_atol_base.c
OBJS = ${SRC:.c=.o}
HEAD = ./includes/
AR = ar rcs
RM = rm -f
CORE = libft_core.a
all: ${NAME}
.c.o:
${CC} ${CFLAGS} -c -I ${HEAD} $< -o ${<:.c=.o}
$(CORE): ${OBJS}
${AR} ${CORE} ${OBJS}
printf: ${CORE}
make -C ./printf all
gnl: ${CORE}
make -C ./get_next_line all
hashtable: ${CORE}
make -C ./hashtable all
${NAME}: ${OBJS} core printf gnl hashtable
ar x ./libft_core.a
ar x ./get_next_line/libgnl.a
ar x ./printf/libftprintf.a
ar x ./hashtable/libhashtable.a
${AR} ${NAME} *.o
rm -f *.o
so:
gcc *.o --shared -o libft.so
clean:
rm -f ${OBJS} ${CORE} *.o
make -C ./printf clean
make -C ./get_next_line clean
make -C ./hashtable clean
fclean: clean
rm -f ${NAME}
make -C ./printf fclean
make -C ./get_next_line fclean
make -C ./hashtable fclean
re: fclean all