-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (41 loc) · 1.03 KB
/
Makefile
File metadata and controls
58 lines (41 loc) · 1.03 KB
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
NAME= libftprintf.a
CC= cc
FLAGS= -Wall -Wextra -Werror
LIBFT_DIR= ./libft
LIBFT= $(LIBFT_DIR)/libft.a
LIBFT_SRCS= $(LIBFT_DIR)/ft_atoi.c \
$(LIBFT_DIR)/ft_putchar.c \
$(LIBFT_DIR)/ft_nbrsize.c \
$(LIBFT_DIR)/ft_putstr.c \
$(LIBFT_DIR)/ft_power.c
LIBFT_INC= $(LIBFT_DIR)/libft.h
SRCS_DIR= ./srcs
SRCS= $(SRCS_DIR)/ft_printf.c \
$(SRCS_DIR)/ft_printf_utils.c \
$(SRCS_DIR)/ft_convert_p.c \
$(SRCS_DIR)/ft_convert_x.c \
$(SRCS_DIR)/ft_convert_u.c \
$(SRCS_DIR)/ft_convert_d_i.c \
$(SRCS_DIR)/ft_convert_c.c \
$(SRCS_DIR)/ft_convert_s.c \
PRINTF_INC= ./includes/
OBJS= $(SRCS:.c=.o)
LIBFT_OBJS= $(LIBFT_SRCS:.c=.o)
INCS= -I$(LIBFT_DIR) -I$(PRINTF_INC)
HEADER= ft_printf.h
%.o: %.c
$(CC) $(FLAGS) $(INCS) -c $< -o $@
all: $(NAME)
$(LIBFT): $(LIBFT_OBJS)
ar -rcs $(LIBFT) $(LIBFT_OBJS)
cp $(LIBFT) $(NAME)
$(NAME): $(OBJS) $(LIBFT)
ar -rcs $(NAME) $(OBJS)
ranlib $(NAME)
clean:
rm -f $(OBJS) $(LIBFT_OBJS)
fclean: clean
rm -f $(NAME) $(LIBFT)
re: fclean all
bonus: all
.PHONY: all clean fclean re