This repository was archived by the owner on Aug 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (53 loc) · 1.43 KB
/
Makefile
File metadata and controls
69 lines (53 loc) · 1.43 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
##
## EPITECH PROJECT, 2023
## B-PDG-300-BDX-3-1-PDGRUSH3-melissa.laget [WSL: Ubuntu]
## File description:
## Makefile
##
SRC = src/strlen.asm \
src/strchr.asm \
src/memcpy.asm \
src/strcmp.asm \
src/strncmp.asm \
src/memmove.asm \
src/strrchr.asm \
src/strstr.asm \
src/strcasecmp.asm \
src/strpbrk.asm \
src/strcspn.asm \
src/memset.asm
SRC_TEST = tests/tests.c
OBJ = $(SRC:.asm=.o)
OBJ_TEST = $(SRC_TEST:.c=.o)
NAME = libasm.so
ASMFLAGS = -f elf64 -D__x86_64__
%.o:%.asm
@$(AS) $(ASMFLAGS) $< -o $@
@if test $*.asm; then \
echo -e "\033[01m\033[33m Compiling...\033[00m\
\033[39m$(SRCPATH)$*.asm\033[032m [OK]\033[00m"; fi
AS = nasm
all: $(NAME)
$(NAME): $(OBJ)
@ld -shared -o $(NAME) $(OBJ)
@echo -e "\e[36;1m--------------------------------------------------\
\e[0m"
@echo -e "\e[36;1m \e[0m\e[32;1mCompilation of the library is done\e[0m\e[36;1m"
@echo -e "\e[36;1m--------------------------------------------------\
\e[0m"
clean:
@rm -f $(OBJ)
@echo -e "\e[31;1mAll files have been cleaned, except $(NAME)\e[0m"
fclean: clean
@rm -f $(NAME)
@echo -e "\e[31;1mAll files have been cleaned\e[0m"
re: fclean all
@echo -e "\e[32;1mAll files have been reloaded\e[0m"
tests_run: LDFLAGS += -L ./
tests_run: LDLIBS += -lcriterion --coverage -ldl
tests_run: all
@$(CC) -o unit_tests $(SRC_TEST) $(OBJ) $(LDFLAGS) $(LDLIBS) -g
@./unit_tests
debug: re
debug: ASMFLAGS += -g
.PHONY: all clean fclean re debug