-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (47 loc) · 954 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
57
58
59
60
61
##
## Makefile for in /home/wilmot_g/Rendu/asm_minilibc
##
## Made by guillaume wilmot
## Login <[email protected]>
##
## Started on Sat Mar 5 19:12:10 2016 Nyrandone Noboud-Inpeng
## Last update Sun Mar 27 16:55:54 2016 Nyrandone Noboud-Inpeng
##
SRC = strlen.S \
strncmp.S \
strcmp.S \
strcasecmp.S \
memset.S \
memcpy.S \
memmove.S \
putchar.S \
putstr.S \
strchr.S \
strstr.S \
rindex.S \
strcspn.S \
strpbrk.S
OBJ = $(addprefix $(OBJDIR), $(SRC:.S=.o))
RM = rm -f
NASM = nasm
CC = gcc
NAME = libasm.so
OBJDIR = obj/
SRCDIR = src/
INCDIR = -I includes/
MAKEOBJ = obj
SFLAGS = -f elf64
CFLAGS = -W -Wall -Wextra -Werror -shared -fPIC
$(OBJDIR)%.o: $(SRCDIR)%.S
@mkdir -p $(MAKEOBJ)
$(NASM) $(SFLAGS) -o $@ $<
$(NAME): $(OBJ)
$(CC) $(OBJ) -o $(NAME) $(CFLAGS)
all:
@make --no-print-directory $(NAME)
clean:
$(RM) $(OBJ)
fclean: clean
$(RM) $(NAME)
$(RM) -R $(OBJDIR)
re: fclean all