-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (32 loc) · 1.47 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gsmereka <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/05/30 22:11:38 by lbiasuz #+# #+# #
# Updated: 2022/12/24 23:28:06 by gsmereka ### ########.fr #
# #
# **************************************************************************** #
NAME = printf.a
CFLAGS = -Wall -Wextra -Werror
SRC_DIR = /src
OBJ_DIR = obj
SRC = ft_printf.c ft_strjoin.c ft_itoa.c ft_itohex.c \
ft_putchar_fd.c ft_putstr_fd.c ft_strdup.c \
ft_utoa.c ft_strchr.c ft_strlen.c ft_toupper.c
HEADER = ./header/ft_printf.h
OBJ = $(addprefix $(OBJ_DIR), $(addprefix $(SRC_DIR)/, $(SRC:.c=.o)))
all: $(NAME)
$(OBJ_DIR)/%.o: %.c
@mkdir -p $(OBJ_DIR) $(OBJ_DIR)$(SRC_DIR)
cc $(CFLAGS) -c $< -o $@
$(NAME): $(HEADER) $(OBJ)
ar -rcs $(NAME) $(OBJ)
clean:
rm -rf $(OBJ) $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: bonus all clean fclean re