-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (24 loc) · 776 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
NAME = libftprintf.a
CC = cc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
SRC = ft_printf.c print_str.c print_nbr.c print_nbr_hex.c
OBJ = $(SRC:.c=.o)
# The default rule that builds the library.
all: $(NAME)
# Build the libft library by running the makefile in the $(LIBFT_PATH) directory.
# Copies the compiled libft.a into the current directory and renames it as libftprintf.a.
# In the context of the make command, the -C option is used to specify a directory where the
# makefile should be located and where the build process should take place.
$(NAME): ${OBJ}
ar -rcs $(NAME) $(OBJ)
$(OBJ):
$(CC) $(CFLAGS) -c $(SRC)
%.o: %.c ft_printf.h
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJ)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re