-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (51 loc) · 1.71 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
67
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mleclair <mleclair@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/09/12 19:21:21 by mleclair #+# #+# #
# Updated: 2018/06/25 14:25:06 by mleclair ### ########.fr #
# #
# **************************************************************************** #
NAME = libfts.a
PATH = ./sprintf/
FILE_S = ft_bzero \
ft_strcat \
ft_isalpha \
ft_isdigit \
ft_isalnum \
ft_isascii \
ft_isprint \
ft_toupper \
ft_tolower \
ft_puts \
ft_strlen \
ft_memset \
ft_memcpy \
ft_strdup \
ft_cat \
OBJ_S := $(addsuffix .o, $(FILE_S))
TEST = test.out
TEST_FILES = main
TEST_OBJ := $(addsuffix .o,$(TEST_FILES))
all: $(NAME)
$(NAME): $(OBJ_S)
@ar rc $(NAME) $(OBJ_S)
$(OBJ_S): %.o: %.s
~/.brew/bin/nasm -f macho64 $< -o $@
test: re $(TEST_OBJ)
clang -Wall -Wextra -Werror $(TEST_OBJ) -I. -L. -lfts -o $(TEST)
$(TEST_OBJ): $(TEST_DIR)%.o: $(TEST_DIR)%.c
clang -Wall -Wextra -Werror -c -I. $< -o $@
clean:
@rm -rf $(OBJ_S)
@rm -rf $(TEST_OBJ)
clean_test:
@rm -rf $(TEST)
fclean: clean
@rm -rf $(NAME)
@rm -rf $(TEST)
re: fclean all
.PHONY : all clean fclean re