-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
60 lines (47 loc) · 1.75 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: psprawka <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/09/24 11:51:37 by psprawka #+# #+# #
# Updated: 2019/09/14 23:40:03 by psprawka ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
NAME = libftprintf.a
FLAGS += -g -Wall -Wextra -Werror
# FLAGS += -fsanitize=address
SRC_DIR = srcs/
FILES = ft_printf.c \
print.c \
gather_flags.c \
str_chr.c \
ptr_dbl.c \
int_uint.c \
tools.c \
ft_libftprintf.c \
HEAD = ./includes
SRC := $(addprefix $(SRC_DIR), $(FILES))
OBJ = $(SRC:.c=.o)
LIBFT = libft/libft.a
BUILD_PRINT = @echo "\r\033[38;5;214m[FT_PRINTF] \x1B[33mBuilding $<"
DONE = @echo "\033[K\033[1;38;5;226mFT_PRINTF ready to use!\x1B[0m"
CLEAN_O = @echo "\033[38;5;246mObject files removed! [FT_PRINTF]\x1B[0m"
CLEAN_A = @echo "\033[38;5;246mExecutable removed! [FT_PRINTF]\x1B[0m"
all: $(NAME)
$(NAME): $(OBJ)
@ar rcs $(NAME) $(OBJ)
$(DONE)
$(OBJ): %.o: %.c
$(BUILD_PRINT)
@gcc $(CFLAGS) -I $(HEAD) -c $< -o $@
clean:
@/bin/rm -rf $(OBJ)
$(CLEAN_O)
fclean: clean
@/bin/rm -rf $(NAME)
$(CLEAN_A)
re: fclean all
.PHONY: all clean fclean re