-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (48 loc) · 2.02 KB
/
Makefile
File metadata and controls
63 lines (48 loc) · 2.02 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: sprodatu <sprodatu@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/11/02 00:27:53 by sprodatu #+# #+# #
# Updated: 2024/05/03 22:08:26 by sprodatu ### ########.fr #
# #
# **************************************************************************** #
CC = cc
# Compiler flags
CFLAGS = -Wall -Wextra -Werror
# Library Name
NAME = libftprintf.a
LIBFT = libft
PRINTF_SRCS = apply_precision.c ft_printf.c ft_putstr.c handle_char.c handle_i_neg_n_min.c \
handle_percent.c handle_uint.c parse_format.c print_hex_prefix.c prnt_hexpad.c \
zero_padding.c add_padding.c calculate_hex_digits.c \
handle_format.c handle_int.c handle_pointer.c is_flag.c print_hex.c print_int_padding.c \
prt_pad_n_prefix.c add_sign.c calculate_padding.c ft_putchar.c ft_utoa.c handle_hexa.c \
handle_int_flags.c handle_str.c print_hex_digit.c print_padding.c put_hexa.c
OBJS = $(PRINTF_SRCS:.c=.o)
# Complete list of Rules
# Rule to make the library
all: $(NAME) $(LIBFT)
# Rule to compile the library
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(LIBFT):
make -C $(LIBFT)
$(NAME): $(OBJS)
ar rcs $(NAME) $(OBJS)
@echo "\033[0;32mcompiled succesfully\033[0m"
bonus:$(NAME)
@echo "\033[0;32mbonus compiled succesfully\033[0m"
clean:
@make -C $(LIBFT) clean
rm -f $(OBJS)
# Rule to clean everything
fclean: clean
@make -C $(LIBFT) fclean
rm -f $(NAME)
# Rule to recompile
re: fclean all
# Phony targets
.PHONY: all clean fclean re