-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (61 loc) · 1.87 KB
/
Makefile
File metadata and controls
79 lines (61 loc) · 1.87 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vtarasiu <vtarasiu@student.unit.ua> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/07/18 21:50:14 by vtarasiu #+# #+# #
# Updated: 2019/07/20 19:18:20 by vtarasiu ### ########.fr #
# #
# **************************************************************************** #
NAME = libfts.a
CC = clang
ASM = nasm
UNAME_S = $(shell uname -s)
ARCH =
ifeq ($(UNAME_S), Linux)
ARCH += elf64
endif
ifeq ($(UNAME_S), Darwin)
ARCH += macho64
endif
INCLUDE = libfts.h
FLAGS = -Wall \
-Wextra \
-Werror \
-g \
#-fsanitize=address
ASM_DIR = ./
ASM_SRC = ft_puts.s \
ft_bzero.s \
ft_strlen.s \
ft_strcat.s \
ft_strdup.s \
ft_isalpha.s \
ft_isascii.s \
ft_isdigit.s \
ft_isprint.s \
ft_toupper.s \
ft_isalnum.s \
ft_toupper.s \
ft_tolower.s \
ft_memcpy.s
OBJ_DIR = obj/
OBJ = $(addprefix $(OBJ_DIR), $(ASM_SRC:.s=.o))
all: $(NAME)
prepare:
mkdir -p $(OBJ_DIR)
$(NAME): prepare | $(OBJ)
ar rc $(NAME) $(OBJ)
ranlib $(NAME)
$(OBJ_DIR)%.o: %.s
$(ASM) -f $(ARCH) -o $@ $<
test: all
$(CC) $(FLAGS) -o test main.c $(NAME) -I.
clean:
/bin/rm -f $(OBJ)
/bin/rm -rf $(OBJ_DIR)
fclean: clean
/bin/rm -f $(NAME)
re: fclean all