-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 660 Bytes
/
Makefile
File metadata and controls
47 lines (36 loc) · 660 Bytes
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
SFILES = ft_strlen.s\
ft_memset.s\
ft_bzero.s\
ft_strcat.s\
ft_isalpha.s\
ft_isdigit.s\
ft_isalnum.s\
ft_isascii.s\
ft_isprint.s\
ft_memcpy.s\
ft_toupper.s\
ft_tolower.s\
ft_putstr.s\
ft_strdup.s
SDIR = srcs
SRCS = $(addprefix $(SDIR)/,$(SFILES))
OBJ = $(SRCS:.s=.o)
NAME = libasm.a
$(ODIR):
@mkdir -p $@
$(SDIR)/%.o: $(SDIR)/%.s
@nasm -f macho64 $< -o $@
all: $(ODIR) $(NAME)
$(NAME): $(OBJ)
@ar -rc $(NAME) $(OBJ)
@ranlib $(NAME)
main: re
@gcc main.c libasm.a
@rm srcs/*.o
@./a.out
clean:
@rm -f $(OBJ)
fclean: clean
@rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re