-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (33 loc) · 714 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (33 loc) · 714 Bytes
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
NAME = libftprintf.a
LIBFT = libft.a
CC = gcc
FLAGS = -Wall -Wextra -Werror
HEADER = ./includes/
LIBFT_DIR = src/libft/
SRC_DIR = src/
SRC = ft_printf.c \
parser.c \
utilities.c \
processor.c \
process_ints.c \
process_unints.c \
process_char.c \
process_hexes.c \
process_string.c \
process_pointers.c
OBJ = $(addprefix $(SRC_DIR), $(SRC:.c=.o))
all: $(SRC_DIR) $(NAME)
$(NAME): $(OBJ)
make -C $(LIBFT_DIR)
cp $(LIBFT_DIR)$(LIBFT) ./$(NAME)
ar -rc $(NAME) $(OBJ)
%.o : %.c
$(CC) $(FLAGS) -I $(HEADER) -c $< -o $(<:.c=.o)
clean:
make clean -C $(LIBFT_DIR)
rm -f $(OBJ) $(OBJ_BONUS)
fclean: clean
rm -f $(LIBFT_DIR)$(LIBFT)
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re