-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (67 loc) · 1.85 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
79
80
81
82
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rnishimo <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/22 21:42:31 by rnishimo #+# #+# #
# Updated: 2022/01/31 11:43:47 by rnishimo ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
SRCS = ft_printf.c \
parser.c \
parser_error.c \
get_c.c \
get_s.c \
get_p.c \
get_d.c \
get_u.c \
get_x.c \
get_xx.c \
get_per.c \
print.c \
init_struct_print.c \
set_number_base.c \
debug.c \
debug1.c \
OBJS = $(SRCS:.c=.o)
CFLAGS = -Wall -Wextra -Werror -g
ifeq ($(findstring debug, $(MAKECMDGOALS)), debug)
DEBUG = -D DEBUG=1
endif
$(NAME): $(OBJS)
make -C ./libft
cp ./libft/libft.a ./$(NAME)
ar rcs $(NAME) $(OBJS)
%.o: %.c
gcc $(CFLAGS) $(DEBUG) -c -o $@ $<
.PHONY: all
all: $(NAME)
.PHONY: clean
clean:
rm -f $(NAME)
.PHONY: fclean
fclean: clean
rm -f $(OBJS)
.PHONY: re
re: fclean all
.PHONY: bonus
bonus: all
# ------------------------------
.PHONY: test
test: re
cd .test && bash test.sh
cd ..
make fclean
.PHONY: norm
norm:
norminette | grep Error | cat
.PHONY: debug
debug: re
.PHONY: submit
submit:
rm -f ./libft/get_next_line.c
cat ./libft/Makefile | grep -v get_next_line > ./libft/tmp
cat ./libft/tmp > ./libft/Makefile