-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (59 loc) · 1.85 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
67
68
69
70
71
72
73
74
75
76
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yichoi <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/13 15:41:17 by yichoi #+# #+# #
# Updated: 2021/12/21 15:44:29 by yichoi ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
AR = ar
ARFLAGS = rcs
RM = rm
RMFLAGS = -f
INCLUDES = ./ft_printf.h
SRCS = ft_printf.c \
ft_format_specifier.c \
ft_write_character.c \
ft_write_string.c \
ft_write_integer.c \
ft_write_decimal.c \
ft_write_unsigned.c \
ft_format_specifier.c \
ft_write_address.c \
ft_write_lower_hex.c \
ft_write_upper_hex.c \
ft_write_percent.c \
pf_strlen.c
//SRCS_BN =
OBJS = $(SRCS:.c=.o)
//OBJS_BONUS = $(SRCS_BN:.c=.o)
//ifdef WITH_BONUS
//A_OBJS = $(OBJS) $(OBJS_BONUS)
//else
//A_OBJS = $(OBJS)
//endif
.PHONY : all
all : $(NAME)
%.o : %.c $(INCLUDES)
$(CC) $(CFLAGS) -c $< -o $@
$(NAME) : $(A_OBJS)
$(AR) $(ARFLAGS) $@ $^
.PHONY : clean
clean :
$(RM) $(RMFLAGS) $(OBJS) $(OBJS_BONUS)
.PHONY : fclean
fclean : clean
$(RM) $(RMFLAGS) $(NAME)
.PHONY : re
re :
$(MAKE) fclean
$(MAKE) caller
//.PHONY : bonus
//bonus :
// $(MAKE) WITH_BONUS=1 all