-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 1.51 KB
/
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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: dreijans <[email protected]> +#+ #
# +#+ #
# Created: 2022/11/15 18:56:16 by dreijans #+# #+# #
# Updated: 2022/12/05 12:07:45 by dreijans ######## odam.nl #
# #
# **************************************************************************** #
NAME = libftprintf.a
CC = cc
SRC = \
ft_printf.c \
print_char.c \
print_nbr.c \
print_hexlow.c \
print_hexup.c \
print_str.c \
print_unsigned.c \
print_ptr.c
OBJ_FILES = $(SRC:.c=.o)
CFLAGS = -Wall -Wextra -Werror
LIB = $(LIBDIR)/libft.a
LIBDIR = Libft
.PHONY: all clear fclean re
all: $(NAME)
$(LIB):
$(MAKE) -C $(LIBDIR) all --quiet
$(NAME): $(OBJ_FILES) $(LIB)
cp $(LIB) $(NAME)
ar -src $(NAME) $(OBJ_FILES)
%.o: %.c
@$(CC) -c $(CFLAGS) -o $@ $^
clean:
$(RM) $(OBJ_FILES)
$(MAKE) -C $(LIBDIR) clean
fclean:
$(RM) $(OBJ_FILES)
$(RM) $(NAME)
$(MAKE) -C $(LIBDIR) fclean
re: fclean all
test: re
gcc -g *.c $(NAME)
./a.out