-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (34 loc) · 996 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
46
NAME = libftprintf.a
CC = gcc
CFLAGS = -I includes/ -Wall -Werror -Wextra
OBJ = $(SRC:.c=.o)
C_OK = "\033[35m"
C_GOOD = "\033[32m"
C_NO = "\033[00m"
SUCCESS = $(C_GOOD)SUCCESS$(C_NO)
OK = $(C_OK)OK$(C_NO)
SRC = print_float.c neg_exp.c sum_char.c tools.c substr.c multiplier.c prec.c \
prec2.c read_format.c ft_printf.c conversion.c print_integer.c \
print_octal_x.c print_unsigned.c print_pointer_char.c print_string.c free.c \
color.c
all: $(NAME)
%.o: %.c
@printf "[ft_printf] Compiling [.:]\r"
@$(CC) $(CFLAGS) -c $< -o $@
@printf "[ft_printf] Compiling [:.]\r"
$(NAME): $(OBJ)
@make -C libft/
@cp libft/libft.a ./$(NAME)
@ar rc $@ $^
@ranlib $@
@echo "Compiling & indexing" [ $(NAME) ] $(SUCCESS)
clean:
@make clean -C libft/
@/bin/rm -f $(OBJ)
@printf "[ft_printf] Removed object files!\n"
fclean: clean
@/bin/rm -f $(NAME)
@make fclean -C libft/
@echo "Cleaning" [ $(NAME) ] "..." $(OK)
re: fclean all
.PHONY: all clean fclean re test