-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (34 loc) · 861 Bytes
/
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
NAME = libftprintf.a
SRCS = printf.c \
libft/ft_putchar.c \
libft/ft_putstr.c \
libft/ft_putnbr.c \
libft/ft_putunsnbr.c \
libft/ft_putunsnbr_base.c \
libft/ft_prsprint.c \
libft/ft_strlen.c \
libft/ft_hexpoint.c \
libft/ft_putlngnbr_base.c \
libft/check_base.c
OBJS = ${SRCS:.c=.o}
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror
COUNTER=1
.c.o:
@echo "\033[1;36mCompiled $(COUNTER) of 11 files\033[0m"
@${CC} ${CFLAGS} -g -c $< -o ${<:.c=.o}
$(eval COUNTER=$(shell echo $$(($(COUNTER)+1))))
$(NAME): ${OBJS}
@echo "\033[1;35mBuilding library...\033[0m"
@ar rcs ${NAME} ${OBJS}
@echo "\033[1;32mDONE!\033[0m"
clean:
@echo "\033[1;32mSome junk removed!\033[0m"
@${RM} ${OBJS}
fclean:
@echo "\033[1;32mAll the junk removed!\033[0m"
@${RM} ${OBJS}
@${RM} ${NAME}
all: ${NAME} ${OBJS}
re: fclean all