-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (84 loc) · 2.21 KB
/
Makefile
File metadata and controls
100 lines (84 loc) · 2.21 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: omaly <omaly@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2025/09/19 10:58:32 by omaly #+# #+# #
# Updated: 2025/09/19 19:04:50 by omaly ### ########.fr #
# #
# **************************************************************************** #
# Program name
NAME := libft.a
# Compilation and flags
CC := cc
CFLAGS := -Wall -Wextra -Werror
# Commands
RM := rm -rf
# Directories
SRC_DIR = ./
BONUS_DIR = ./
OBJ_DIR = objs
SRC = ft_isalpha \
ft_memset \
ft_bzero \
ft_memcpy \
ft_memmove \
ft_memchr \
ft_memcmp \
ft_strlen \
ft_isdigit \
ft_isalnum \
ft_isascii \
ft_isprint \
ft_strlcpy \
ft_strlcat \
ft_toupper \
ft_tolower \
ft_strchr \
ft_strrchr \
ft_strncmp \
ft_strnstr \
ft_atoi \
ft_itoa \
ft_calloc \
ft_strdup \
ft_split \
ft_substr \
ft_strjoin \
ft_strtrim \
ft_strmapi \
ft_striteri \
ft_putchar_fd \
ft_putstr_fd \
ft_putendl_fd \
ft_putnbr_fd
BONUS_SRC = ft_lstnew \
ft_lstadd_front \
ft_lstsize \
ft_lstlast \
ft_lstadd_back \
ft_lstdelone \
ft_lstclear \
ft_lstiter \
ft_lstmap
SRCS = $(addprefix $(SRC_DIR)/, $(addsuffix .c, $(SRC)))
BONUS_SRCS = $(addprefix $(BONUS_DIR)/, $(addsuffix .c, $(BONUS_SRC)))
OBJS = $(SRCS:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
BONUS_OBJS = $(BONUS_SRCS:$(BONUS_DIR)/%.c=$(OBJ_DIR)/%.o)
all: $(NAME)
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
$(CC) $(CFLAGS) -I . -c $< -o $@
$(NAME): $(OBJS)
ar rcs $(NAME) $(OBJS)
bonus: $(OBJS) $(BONUS_OBJS)
ar rcs $(NAME) $(BONUS_OBJS)
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re bonus