-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (54 loc) · 1.68 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: alischyn <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/03/22 16:43:25 by alischyn #+# #+# #
# Updated: 2017/03/23 19:16:46 by alischyn ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra
SOURCES = ft_printf.c \
parse.c \
parse_flags.c \
parse_width.c \
parse_precision.c \
parse_mod.c \
str_alloc.c \
str_append_char.c \
str_append_string.c \
format.c \
format_char.c \
format_string.c \
format_unknown.c \
pull_number.c \
format_number.c \
format_number_decimal.c \
format_number_octal.c \
format_number_hexadecimal.c \
format_n.c
OBJECTS = $(addprefix obj/,$(subst .c,.o,$(SOURCES)))
NAME = libftprintf.a
ifeq ($(DEBUG),1)
CFLAGS += -g
else
CFLAGS += -O3
endif
all: $(NAME)
$(NAME): $(OBJECTS)
ar -cru $@ $^
obj/%.o: %.c *.h
@mkdir -p obj
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -rf obj
fclean:
rm -rf obj $(NAME)
re: fclean all
norm:
norminette *.c *.h
test: all
$(CC) test.c $(NAME) -o test