-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (49 loc) · 1.71 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kyuki <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/08/18 17:12:33 by kyuki #+# #+# #
# Updated: 2020/11/23 19:11:41 by kyuki ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
GCC = gcc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
INCDIR = ./includes
SRCDIR = ./srcs
LIBFT = srcs/libft
SRCS_LIST = ft_printf.c \
ft_printf_flag.c \
ft_print_c.c \
ft_print_s.c \
ft_print_s_null.c \
ft_print_percent.c \
ft_print_int.c \
ft_print_unsigned.c \
ft_print_unsigned_long.c \
ft_printf_utils.c \
ft_printf.c \
ft_initialize.c \
SRCS = $(addprefix $(SRCDIR)/, $(SRCS_LIST))
OBJS = $(SRCS:.c=.o)
.c.o:
$(CC) $(CFLAGS) -I $(INCDIR) -c $< -o $(<:.c=.o)
$(NAME): ${OBJS}
make -C $(LIBFT)
echo Compiling $(NAME)
cp srcs/libft/libft.a ./$(NAME)
ar -rcs $(NAME) $(OBJS)
echo ====DONE====
all: $(NAME)
clean:
$(RM) $(OBJS)
make clean -C $(LIBFT)
fclean: clean
$(RM) $(NAME)
make fclean -C $(LIBFT)
re: fclean all
.PHONY: clean fclean all re