-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
65 lines (41 loc) · 1.18 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
NAME = libftprintf.a
CC = gcc
CFLAGS += -Werror -Wall -Wextra
AR = ar -rcs
SRC = ft_printf.c \
ft_printf_format.c \
ft_printf_flags.c \
types/ft_printf_alpha.c \
types/ft_printf_i.c \
types/ft_printf_hex.c \
types/ft_printf_u.c \
types/ft_printf_p.c \
utils/ft_printf_utils_char.c \
utils/ft_printf_utils_int.c
SRC_BONUS = bonus/ft_printf_bonus.c \
bonus/ft_printf_format_bonus.c \
bonus/ft_printf_flags_bonus.c \
bonus/types/ft_printf_alpha_bonus.c \
bonus/types/ft_printf_i_bonus.c \
bonus/types/ft_printf_hex_bonus.c \
bonus/types/ft_printf_u_bonus.c \
bonus/types/ft_printf_p_bonus.c \
bonus/utils/ft_printf_utils_char_bonus.c \
bonus/utils/ft_printf_utils_int_bonus.c
OBJS = $(SRC:%.c=%.o)
OBJS_BONUS = $(SRC_BONUS:%.c=%.o)
all: $(NAME)
$(NAME): $(OBJS) ft_printf.h
$(AR) $(NAME) $(OBJS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ -I.
bonus: $(OBJS_BONUS) $(OBJS) ft_printf.h
$(AR) $(NAME) $(OBJS) $(OBJS_BONUS)
#main:
# $(CC) $(CFLAGS) -o $(NAME) $(SRC) main.c && ./$(NAME)
clean:
rm -rf $(OBJS) $(OBJS_BONUS)
fclean: clean
rm -rf $(NAME)
re: fclean all
.PHONY: clean fclean all re