-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (42 loc) · 1.63 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: adono-ma <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/05/23 19:11:33 by adono-ma #+# #+# #
# Updated: 2024/05/23 19:11:33 by adono-ma ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
CC = gcc
CFLAGS = -Wall -Werror -Wextra
AR = ar rcs
SRC = ft_printf.c \
libft_ft_strchr.c \
print_char.c \
print_putbase.c \
print_integer.c \
print_point.c \
print_str.c \
print_unsig.c \
OBJ = $(SRC:%.c=%.o)
RM = rm
RMFLAGS = -f
# Phony tells the makefile to take YOUR rules, not the defaut ones
.PHONY: clean fclean re all
all: $(NAME)
$(NAME): $(OBJ)
$(AR) $(NAME) ${OBJ}
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# $< first prerequirement to create my output (in this case SRC)
# $@ -> target. is the same as to put
# $(OBJ): $(SRC)
clean:
$(RM) $(RMFLAGS) $(OBJ)
#it might work with %.o, check it out
fclean: clean
$(RM) $(RMFLAGS) $(NAME) $(OBJ)
re: fclean all