-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (59 loc) · 2.03 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
77
78
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vmiachko <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/03/04 15:53:54 by vmiachko #+# #+# #
# Updated: 2018/03/10 15:33:12 by vmiachko ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
RM = rm -f
SRC = convert_to_another_base ft_itoa_for_ui ft_printf get_specifier \
get_specifier1 hash parsing parsing1 \
parsing_tools result_output parsing2 parsing_tools1
CFILES = $(patsubst %, %.c, $(SRC))
OFILES = $(patsubst %, %.o, $(SRC))
INCLUDES = ./includes
CFLAGS = -Wall -Wextra -Werror
LIB_DIR = ./libft/
LIB_FILES = ft_strncpy \
ft_realloc \
ft_memalloc \
ft_memcpy \
ft_strlen \
ft_memset \
ft_atoi \
ft_itoa \
ft_count_digits \
ft_putstr \
ft_putchar \
ft_strcpy \
ft_decode \
ft_strjoin \
ft_strnew \
ft_strcmp \
ft_putstr_fixed_size \
ft_realloc_fixed_size \
ft_strdup
LIB_CFILES = $(patsubst %, $(LIB_DIR)%.c, $(LIB_FILES))
LIB_OFILES = $(patsubst %, %.o, $(LIB_FILES))
LIB_INC = -I $(LIB_DIR)includes/
all : $(NAME)
$(NAME) : $(OFILES)
make -C $(LIB_DIR)
ar rc $(NAME) $(OFILES) $(LIB_OFILES)
ranlib $(NAME)
$(OFILES) :
gcc $(CFLAGS) -c -I $(INCLUDES) $(LIB_INC) $(LIB_CFILES) $(CFILES)
clean :
make -C $(LIB_DIR) clean
$(RM) $(OFILES)
$(RM) $(LIB_OFILES)
fclean : clean
make -C $(LIB_DIR) fclean
$(RM) $(NAME)
re : fclean all
.PHONY: all clean fclean re