-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (55 loc) · 1.81 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rcammaro <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/11/18 13:39:16 by rcammaro #+# #+# #
# Updated: 2021/01/27 14:42:21 by rcammaro ### ########.fr #
# #
# **************************************************************************** #
SOURCES = ft_printf.c \
ft_utoa_base.c \
ft_lltoa.c \
ft_wchar_to_mb.c \
parser.c \
parser2.c \
convert_char.c \
convert_string.c \
convert_integer.c \
convert_pointer.c \
convert_n.c \
convert_float.c \
convert_f.c \
convert_e.c \
convert_g.c \
check_overflow.c \
unknown_conversion.c \
helpers.c \
formating.c \
formating2.c
NAME = libftprintf.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LIBFT = libft/libft.a
SRC = $(addprefix srcs/,$(SOURCES))
OBJ = $(SRC:.c=.o)
HEADERS = includes/ft_printf_utils.h includes/ft_printf.h
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
cp $(LIBFT) $@
ar -rcs $@ $(OBJ)
$(LIBFT):
$(MAKE) -C libft
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -I./includes -o $@ -c $<
clean:
$(MAKE) clean -C libft
rm -f $(OBJ)
fclean: clean
rm -f $(LIBFT)
rm -f $(NAME)
re: fclean all
bonus: all
.PHONY: all clean fclean re bonus