-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.83 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: nsierra- <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/22 13:56:55 by nsierra- #+# #+# #
# Updated: 2021/12/01 03:08:40 by nsierra- ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
SRC = ft_printf.c \
state/state_default.c \
state/state_conversion_flags.c \
state/state_conversion_length.c \
state/state_conversion_precision.c \
state/state_conversion_print.c \
state/state_wrong_flag.c \
conversion/print_character.c \
conversion/print_string.c \
conversion/print_pointer.c \
conversion/print_int.c \
conversion/print_unsigned_int.c \
conversion/print_hex_lowercase.c \
conversion/print_hex_uppercase.c \
conversion/print_flag.c \
utils.c
OBJ = $(SRC:.c=.o)
CC = gcc
CFLAGS = -Wall -Wextra -Werror
IFLAGS = -I./ -I./libft/
LFLAGS = -L. -lftprintf
all: $(NAME)
$(NAME): libft/libft.a $(OBJ)
ar rcs $(NAME) $(OBJ) libft/*.o # This destroys me inside
%.o:%.c
$(CC) $(CFLAGS) $(IFLAGS) -c $< -o $@
libft/libft.a:
make -C libft/ bonus
bonus: $(NAME)
clean:
make -C libft/ clean
rm -f $(OBJ) $(OBJ_BONUS)
fclean: clean
make -C libft/ fclean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re test bonus