-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (53 loc) · 1.26 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
57
58
59
60
61
62
63
64
65
66
NAME = libfts.a
SOURCE = source/ft_bzero.s \
source/ft_strcat.s \
source/ft_isalpha.s \
source/ft_isdigit.s \
source/ft_isalnum.s \
source/ft_isascii.s \
source/ft_isprint.s \
source/ft_toupper.s \
source/ft_tolower.s \
source/ft_puts.s \
source/ft_strlen.s \
source/ft_memset.s \
source/ft_memcpy.s \
source/ft_strdup.s \
source/ft_cat.s
INCLUDE = -Iinclude
OBJECT = $(SOURCE:.s=.o)
TEST_NAME = tests
TEST_SOURCE = test/test.c \
test/ft_bzero_test.c \
test/ft_strcat_test.c \
test/ft_ctype_test.c \
test/ft_tox_test.c \
test/ft_puts_test.c \
test/ft_strlen_test.c \
test/ft_memset_test.c \
test/ft_memcpy_test.c \
test/ft_strdup_test.c \
test/ft_cat_test.c
TEST_INCLUDE = -Itest
TEST_OBJECT = $(TEST_SOURCE:.c=.o)
AS = nasm
ASFLAGS = -f macho64
CC = gcc
CFLAGS = -Wall -Werror -Wextra $(INCLUDE) $(TEST_INCLUDE)
all: $(NAME)
$(NAME): $(OBJECT)
ar rc $(NAME) $(OBJECT)
clean:
rm -f $(OBJECT)
fclean: clean
rm -f $(NAME)
re: fclean all
# Tests
runtests: $(NAME) $(TEST_OBJECT)
gcc -o $(TEST_NAME) $(TEST_OBJECT) -L. -lfts
./$(TEST_NAME)
cleantests:
rm -rf $(TEST_OBJECT)
fcleantests: cleantests
rm -rf $(TEST_NAME)
.PHONY: all clean fclean re runtests cleantests fcleantests