-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (39 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
46
47
48
49
50
51
52
53
54
55
56
57
CC = cc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
AR = ar rcs
NAME = libftprintf.a
HEADER = ft_printf.h
LIBFT = ./libft/Make_and_Library/libft.a
LIBFTLOC = ./libft/Make_and_Library/
SRC = ft_print_char.c \
ft_printf_normal.c \
ft_printf.c \
ft_putnbr_count.c \
ft_strlen_count.c \
ft_putstr_count.c \
ft_print_unsigned.c \
ft_print_hex.c \
ft_print_pointer.c
OBJ = $(SRC:.c=.o)
.SILENT:
all: $(NAME)
$(NAME): $(OBJ) $(LIBFT)
cp $(LIBFT) .
mv libft.a $(NAME)
$(AR) $(NAME) $(OBJ)
echo "Library is workies"
$(LIBFT):
$(MAKE) -C $(LIBFTLOC)
%.o: %.c $(HEADER)
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJ)
$(MAKE) -C $(LIBFTLOC) clean
echo "Cleaning has been completed"
fclean: clean
$(RM) $(NAME)
$(MAKE) -C $(LIBFTLOC) fclean
echo "Thorough cleaning has been completed"
re: all
.PHONY: all clean fclean re