-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·59 lines (44 loc) · 3.21 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: orekabe <orekabe@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/16 15:37:42 by orekabe #+# #+# #
# Updated: 2022/01/15 20:23:42 by orekabe ### ########.fr #
# #
# **************************************************************************** #
CC = cc
CFLAGS = -Wall -Wextra -Werror
NAME = libftprintf.a
HEADER = -I./include
SRCD = ./src
OBJD = ./objs
SRC = $(SRCD)/ft_printf.c $(SRCD)/ft_putchar.c $(SRCD)/ft_putstr.c $(SRCD)/ft_putnbr.c $(SRCD)/ft_puthex.c $(SRCD)/ft_putaddress.c $(SRCD)/ft_fill_width.c $(SRCD)/ft_fill_prec.c \
$(SRCD)/ft_conversion1.c $(SRCD)/ft_conversion2.c $(SRCD)/ft_flags2.c $(SRCD)/ft_check_specifier.c $(SRCD)/ft_isdigit.c $(SRCD)/ft_flags2_w.c $(SRCD)/ft_print1.c $(SRCD)/ft_print2.c \
$(SRCD)/ft_check_hash.c $(SRCD)/ft_check_plus.c $(SRCD)/ft_check_decimal.c $(SRCD)/ft_check_hexa.c $(SRCD)/ft_check_flags.c $(SRCD)/ft_get_flags1.c $(SRCD)/ft_strlen.c $(SRCD)/ft_count_len.c \
$(SRCD)/ft_putnchar.c $(SRCD)/ft_putnstr.c $(SRCD)/ft_putnnbr.c $(SRCD)/ft_putunbr.c $(SRCD)/ft_putnhex.c $(SRCD)/ft_putnaddress.c $(SRCD)/ft_atoi.c $(SRCD)/ft_flags1.c $(SRCD)/ft_check_after_percentage.c
OBJ = $(addprefix $(OBJD)/, $(notdir $(SRC:.c=.o)))
all: $(NAME)
$(NAME): $(OBJ)
@ar -rc $(NAME) $^
@printf " \r"
@echo "███████╗████████╗ ██████╗ ██████╗ ██╗███╗ ██╗████████╗███████╗"
@echo "██╔════╝╚══██╔══╝ ██╔══██╗██╔══██╗██║████╗ ██║╚══██╔══╝██╔════╝"
@echo "█████╗ ██║ ██████╔╝██████╔╝██║██╔██╗ ██║ ██║ █████╗ "
@echo "██╔══╝ ██║ ██╔═══╝ ██╔══██╗██║██║╚██╗██║ ██║ ██╔══╝"
@echo "██║ ██║███████╗██║ ██║ ██║██║██║ ╚████║ ██║ ██║ "
@echo "╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ "
@echo " BY: MTRX "
$(OBJD)/%.o: $(SRCD)/%.c
@mkdir -p $(OBJD)
@printf " \r"
@printf "Compiling $<\r"
@$(CC) -c $(CFLAGS) $(HEADER) $< -o $@
clean:
rm -rf $(OBJD)
fclean: clean
rm -f $(NAME)
re: fclean all
bonus: re