-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (45 loc) · 2.11 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: user <user@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/05/10 21:07:48 by unite #+# #+# #
# Updated: 2020/10/14 23:28:20 by user ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintfgnl.a
################################################################################
COMPILE = gcc -c
ARCHIVE = ar rc
INDEX = ranlib
LINK = gcc
CFLAGS = -Wall -Wextra -Werror
CFLAGS_DEPEND = -MMD
ifeq ($(DEBUG), 1)
COMPILE += -g
endif
############################## LINK OBJECT FILES ###############################
$(NAME): ft_printf/libftprintf.a get_next_line/get_next_line.o
cp ft_printf/libftprintf.a $(NAME)
$(ARCHIVE) $(NAME) get_next_line/get_next_line.o
$(INDEX) $(NAME)
################################ COMPILING GNL #################################
get_next_line/get_next_line.o: get_next_line/get_next_line.c
$(COMPILE) $(CFLAGS) $(CFLAGS_DEPEND) $< -o $@ \
-I libft/ -I get_next_line/
-include get_next_line/get_next_line.d
################################################################################
.DEFAULT_GOAL = all
.PHONY : all clean fclean re libftprintf
all: libftprintf $(NAME)
clean:
$(MAKE) -C ft_printf fclean PATHFT=../libft
rm -f get_next_line/get_next_line.o get_next_line/get_next_line.d
fclean: clean
rm -f $(NAME)
re: fclean all
libftprintf:
$(MAKE) -C ft_printf all PATHFT=../libft DEBUG=$(DEBUG)
################################################################################