-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (67 loc) · 2.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mbutt <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/08/07 15:20:38 by mbutt #+# #+# #
# Updated: 2019/09/30 12:23:30 by mbutt ### ########.fr #
# #
# **************************************************************************** #
NC:=\033[0m
GREEN:=\033[1;32m
ORANGE:=\033[0;33m
YELLOW:=\033[1;33m
CYAN:=\033[1;36m
NAME = libftprintf.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror -I. -c
OPTIMIZE = -O2
#SRC = $(filter-out main.c, $(wildcard *.c)) // Changing path to srcs
#MINI_LIBFT = mini_libft/*.c // Changing path to srcs
#SRC = $(filter-out srcs/main.c, $(wildcard srcs/*.c)) // Not using wildcard
#MINI_LIBFT = srcs/mini_libft/*.c // Including files manually
SRC = srcs/append_to_buffer.c \
srcs/collect_and_cancel_flags.c \
srcs/collect_width_precision_length_type.c \
srcs/ft_itoa_min_handler.c \
srcs/ft_printf.c \
srcs/parsing.c \
srcs/type_field_b.c \
srcs/type_field_c.c \
srcs/type_field_d_i.c \
srcs/type_field_f.c \
srcs/type_field_o.c \
srcs/type_field_p.c \
srcs/type_field_percent.c \
srcs/type_field_s.c \
srcs/type_field_u.c \
srcs/type_field_x.c \
srcs/type_field_x_remaining_conditions.c \
MINI_LIBFT = srcs/mini_libft/ft_atoi.c \
srcs/mini_libft/ft_bzero.c \
srcs/mini_libft/ft_ftoa.c \
srcs/mini_libft/ft_hex.c \
srcs/mini_libft/ft_isdigit.c \
srcs/mini_libft/ft_itoa_base.c \
srcs/mini_libft/ft_strcat.c \
srcs/mini_libft/ft_strcpy.c \
srcs/mini_libft/ft_strlen.c \
srcs/mini_libft/utility.c \
OBJ = *.o
all: $(NAME)
$(NAME):
@echo "${CYAN}Compiling Makefile.${NC}"
@$(CC) $(CFLAGS) $(OPTIMIZE) $(SRC) $(MINI_LIBFT)
@ar rc $(NAME) $(OBJ)
@echo "${GREEN}Generated libftprintf.a static library succesfully.${NC}"
clean:
rm -rf $(OBJ)
@echo "${ORANGE}Removed object files.${NC}"
fclean:
rm -rf $(NAME) $(OBJ)
@echo "${ORANGE}Removed object files.${NC}"
@echo "${YELLOW}Removed static library.${NC}"
re: fclean all
.PHONY: all clean fclean re