-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (46 loc) · 1.79 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mavinici <mavinici@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/06/17 10:52:08 by mavinici #+# #+# #
# Updated: 2021/06/17 10:52:08 by mavinici ### ########.fr #
# #
# **************************************************************************** #
LIBFT_PATH = libft
LIBFT = $(LIBFT_PATH)/libft.a
NAME = libftprintf.a
SRCS_PATH = srcs
SRCS = $(SRCS_PATH)/ft_printf.c \
$(SRCS_PATH)/print_string.c \
$(SRCS_PATH)/print_char.c \
$(SRCS_PATH)/print_ptr.c \
$(SRCS_PATH)/print_integer.c \
$(SRCS_PATH)/check_options.c \
$(SRCS_PATH)/print_porcent.c \
OBJS_PATH = objs
OBJS = $(patsubst $(SRCS_PATH)/%.c, $(OBJS_PATH)/%.o, $(SRCS))
WHERE = .
CC = clang
RM = rm -rf
CFLAGS = -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(OBJS)
@make -C $(LIBFT_PATH)
cp $(LIBFT) $(NAME)
mv $(LIBFT) $(NAME)
ar rc $(NAME) $(OBJS)
$(OBJS_PATH)/%.o: $(SRCS_PATH)/%.c
@mkdir -p $(OBJS_PATH)
$(CC) $(CFLAGS) -I. -I/$(LIBFT_PATH) -c $< -o $@
bonus: all
clean:
@make clean -C $(LIBFT_PATH)
$(RM) $(OBJS_PATH)
fclean: clean
@make fclean -C $(LIBFT_PATH)
$(RM) $(NAME) libft.a
re: fclean all
.PHONY: all fclean clean re