-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 963 Bytes
/
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
SRCS = ft_strlen.s\
ft_strcpy.s\
ft_strcmp.s\
ft_write.s\
ft_read.s\
ft_strdup.s
SRCSBONUS = ft_atoi_base_bonus.s\
ft_list_push_front_bonus.s\
ft_list_size_bonus.s\
ft_list_sort_bonus.s\
ft_list_remove_if_bonus.s
SRCC = main.c
SRCCBONUS = main_bonus.c
NAME = libasm.a
NAMEBONUS = libasmbonus.a
OBJS = $(SRCS:.s=.o)
OBJSBONUS = $(SRCSBONUS:.s=.o)
OBJC = $(SRCC:.c=.o)
OBJCBONUS = $(SRCCBONUS:.c=.o)
CFLAGS = -Wall -Wextra -Werror
ASFLAGS = -fmacho64
AR = ar rc
CC = gcc
AS = nasm
all: $(NAME)
$(NAMEBONUS): $(OBJS) $(OBJSBONUS)
$(AR) $(NAMEBONUS) $(OBJS) $(OBJSBONUS)
$(NAME): $(OBJS)
$(AR) $(NAME) $(OBJS)
bonus: $(NAMEBONUS)
test: all $(OBJC)
$(CC) -L. -lasm $(OBJC)
./a.out
test_bonus: bonus $(OBJCBONUS)
$(CC) -L. -lasmbonus $(OBJCBONUS)
./a.out
clean:
$(RM) $(OBJS)
$(RM) $(OBJC)
fclean: clean
$(RM) $(NAME)
re: fclean all