-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (59 loc) · 1.77 KB
/
Makefile
File metadata and controls
74 lines (59 loc) · 1.77 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
NAME = libftprintf.a
CC = cc
CFLAGS = -Wall -Wextra -Werror -g3 # -Weverything -std=gnu18 \
-Wno-poison-system-directories -Wno-cast-qual -Wno-padded
LIBFT_PATH = ./libft
INCLUDE_DIR = ./inc
INCLUDES = -I $(INCLUDE_DIR) -I $(LIBFT_PATH)/inc
SOURCE_DIR = src
SOURCES = ft_printf.c \
\
convert/convert_from_char.c \
convert/convert_from_char_ptr.c \
convert/convert_from_character.c \
convert/convert_from_double.c \
convert/convert_from_int.c \
convert/convert_from_long.c \
convert/convert_from_long_double.c \
convert/convert_from_long_long.c \
convert/convert_from_short.c \
convert/convert_from_string.c \
convert/convert_from_u_char.c \
convert/convert_from_u_int.c \
convert/convert_from_u_long.c \
convert/convert_from_u_long_long.c \
convert/convert_from_u_short.c \
convert/convert_from_void_ptr.c \
\
format_specifier/format_specifier.c \
format_specifier/format_specifier_flag.c \
format_specifier/format_specifier_length.c \
format_specifier/format_specifier_parameter.c \
format_specifier/format_specifier_precision.c \
format_specifier/format_specifier_to_string.c \
format_specifier/format_specifier_type.c \
format_specifier/format_specifier_width.c \
\
token_decorator/token_decorator_character.c \
token_decorator/token_decorator_number.c \
token_decorator/token_decorator_string.c
OBJ_DIR = obj
OBJS = $(patsubst %.c, %.o, $(addprefix $(SOURCE_DIR)/, $(SOURCES)))
all: $(NAME)
$(NAME): $(OBJS)
make all -C $(LIBFT_PATH)
cp $(LIBFT_PATH)/libft.a $(NAME)
ar rcs $(NAME) $(OBJS)
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
make clean -C $(LIBFT_PATH)
rm -rf $(OBJS)
fclean: clean
make fclean -C $(LIBFT_PATH)
rm -f $(NAME)
bonus:
re:
make re -C $(LIBFT_PATH)
make
.PHONY: all clean fclean re