-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (49 loc) · 1.84 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: ksmorozo <[email protected]> +#+ #
# +#+ #
# Created: 2021/01/18 14:53:34 by ksmorozo #+# #+# #
# Updated: 2021/02/17 13:18:06 by ksmorozo ######## odam.nl #
# #
# **************************************************************************** #
NAME = libftprintf.a
SRC_FILE = ft_printf.c
HEADER_FILES = ft_printf.h
PARSE_DIR = parser/
PARSE_SRC_FILES = parse.c \
parse_flag.c parse_width.c \
parse_length.c parse_precision.c \
parse_type.c
PROCESSOR_DIR = processor/
PROCESSOR_SRC_FILES = print.c \
print_char.c write_padding.c \
print_hex.c count_num_length.c \
print_d_i.c print_percent.c \
print_ptr.c print_str.c \
print_d_i_u_utils.c print_hex_utils.c \
print_u.c
LIBFT_DIR = libft/
LIBFT = libft.a
CFLAGS = -g -Wall -Wextra -Werror
OBJ_FILES = $(SRC_FILE:.c=.o) \
$(addprefix $(PARSE_DIR), $(PARSE_SRC_FILES:.c=.o)) \
$(addprefix $(PROCESSOR_DIR), $(PROCESSOR_SRC_FILES:.c=.o))
all: $(NAME)
$(NAME): $(OBJ_FILES)
make -C $(LIBFT_DIR)
cp $(LIBFT_DIR)$(LIBFT) $(NAME)
ar rc $@ $^
ranlib $@
%.o: %.c $(HEADER_FILES)
$(CC) -c $(CFLAGS) -o $@ $<
clean:
rm -f $(OBJ_FILES)
make clean -C $(LIBFT_DIR)
fclean: clean
rm -f $(NAME) $(LIBFT_DIR)$(LIBFT)
re: fclean all
bonus: $(NAME)
.PHONY: all clean fclean re bonus