-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (58 loc) · 1.22 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
#var
CC = gcc
NASM = ~/.brew/bin/nasm
NAME = libfts.a
CFLAGS = -Wall -Wextra -Werror # -ltermcap #-L/usr/X11/lib -lmlx -lXext -lX11
NFLAGS = #-Wall -Wextra -Werror # -ltermcap #-L/usr/X11/lib -lmlx -lXext -lX11
OBJDIR = obj/
SRCS_C =
SRCS_S = \
ft_strlen.s \
ft_strcat.s \
ft_puts.s \
ft_isalpha.s \
ft_isalnum.s \
ft_isdigit.s \
ft_isascii.s \
ft_isprint.s \
ft_toupper.s \
ft_tolower.s \
ft_memset.s \
ft_memcpy.s \
ft_strdup.s \
ft_cat.s \
ft_memalloc.s \
ft_atoi.s \
ft_itoa.s \
ft_bzero.s \
ft_strnew.s \
ft_strjoin.s \
ft_strfjoin.s \
ft_strchr.s \
ft_strsub.s
HEADER = libfts.h
OBJS_C = $(addprefix $(OBJDIR),$(subst .c,.o,$(SRCS_C)))
OBJS_S = $(addprefix $(OBJDIR),$(subst .s,.o,$(SRCS_S)))
OBJS = $(OBJS_C) $(OBJS_S)
INCLUDES = -I.
.PHONY: all clean fclean re proper
all: $(NAME)
$(NAME): $(OBJS) $(HEADER)
ar rc $(NAME) $(OBJS)
ranlib $(NAME)
$(OBJS): | $(OBJDIR)
$(OBJDIR)%.o : %.s $(HEADER)
$(NASM) $(NCFLAGS) -f macho64 $< -o $@
$(OBJDIR)%.o : %.c $(HEADER)
$(CC) $(CFLAGS) -c $< -o $@ $(INCLUDES)
$(OBJDIR):
@if [ ! -d "$(OBJDIR)" ]; then \
mkdir $(OBJDIR);\
fi
clean:
rm -rf $(OBJS)
rm -rf $(OBJDIR)
fclean: clean
rm -rf $(NAME)
proper: all clean
re: fclean all