-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (61 loc) · 1.24 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
##
##EPITECH PROJECT, 2022
## minilibc
## File description:
## makefile
##
CC = gcc
LD = ld
NASM = nasm
SRC = src/strlen.asm \
src/strchr.asm \
src/strrchr.asm \
src/memset.asm \
src/memcpy.asm \
src/strcmp.asm \
src/memmove.asm \
src/strncmp.asm \
src/strcasecmp.asm \
src/strstr.asm \
src/strpbrk.asm \
src/strcspn.asm \
src/ffs.asm \
src/memfrob.asm \
src/strfry.asm \
SRCTEST = tests/test_strlen.c \
tests/test_strchr.c \
tests/test_strrchr.c \
tests/test_memset.c \
tests/test_memcpy.c \
tests/test_strcmp.c \
tests/test_memmove.c \
tests/test_strncmp.c \
tests/test_strcasecmp.c \
tests/test_strstr.c \
tests/test_strpbrk.c \
tests/test_strcspn.c \
tests/test_ffs.c \
tests/test_index.c \
tests/test_rindex.c \
tests/test_memfrob.c \
tests/test_strfry.c \
OBJS = $(SRC:.asm=.o)
LDFLAGS = -shared
ASMFLAGS = -f elf64
NAME = libasm.so
NAMETEST = test
all: $(NAME)
$(NAME): $(OBJS)
$(LD) -o $(NAME) $(OBJS) $(LDFLAGS)
%.o: %.asm
$(NASM) $(ASMFLAGS) -o $@ $<
tests_run: fclean $(NAME)
$(CC) -o $(NAMETEST) $(SRCTEST) --coverage -lcriterion -ldl
./$(NAMETEST)
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) *.gcda *.gcno
$(RM) $(NAME)
$(RM) $(NAMETEST)
re: fclean all