-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (72 loc) · 1.89 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: pguillie <pguillie@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/12/09 10:05:42 by pguillie #+# #+# #
# Updated: 2019/09/02 09:51:26 by pguillie ### ########.fr #
# #
# **************************************************************************** #
NAME := libfts.a
AS := nasm
AR := ar
ASFLAGS = -f$(arch)
ARFLAGS = cr
os != uname
ifeq ($(os), Linux)
arch := elf64
ARFLAGS += -U
else
arch := macho64
ASFLAGS += --prefix _
endif
incdir := ./include/
srcdir := ./src/
headers := libfts.h ft_ctype.h
sources := $(addprefix $(srcdir), \
$(addprefix ctype/, \
ft_ctype.s \
ft_isalnum.s \
ft_isalpha.s \
ft_isascii.s \
ft_isblank.s \
ft_iscntrl.s \
ft_isdigit.s \
ft_isgraph.s \
ft_islower.s \
ft_isprint.s \
ft_ispunct.s \
ft_isspace.s \
ft_isupper.s \
ft_isxdigit.s \
) \
ft_bzero.s \
ft_cat.s \
ft_memchr.s \
ft_memcmp.s \
ft_memcpy.s \
ft_memset.s \
ft_putchar.s \
ft_puts.s \
ft_strcat.s \
ft_strchr.s \
ft_strcmp.s \
ft_strdup.s \
ft_strlen.s \
ft_tolower.s \
ft_toupper.s \
)
objects = $(sources:%.s=%.o)
.PHONY: all clean fclean re
.SECONDARY: $(objects)
all: $(NAME)
$(NAME): $(NAME)($(objects))
ranlib $@
$(objects): $(addprefix $(incdir), $(headers))
clean:
$(RM) $(objects)
fclean: clean
$(RM) $(NAME)
re: fclean all