-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (72 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
79
80
# SPDX-License-Identifier: MIT
CFLAGS = -I./include -O3 -nostdinc -nostdlib
CFLAGS += -m64 -march=x86-64 -mno-sse2 -fPIE
CFLAGS += -fno-stack-protector
CFLAGS += -ffreestanding
CC := gcc
PREFIX := /usr/local/
OBJS := $(addprefix src/, \
crt_wrapper.o \
strcasecmp.o \
strncasecmp.o \
strcat.o \
strchrnul.o \
strlen.o \
strcmp.o \
strchr.o \
strncat.o \
strncmp.o \
stpncpy.o \
stpcpy.o \
strcpy.o \
strncpy.o \
strstr.o \
memchr.o \
memcpy.o \
memmove.o \
memset.o \
memcmp.o \
snprintf.o \
vsnprintf.o \
printf.o \
strdup.o \
fseek.o \
ftell.o \
time.o \
rand.o \
getpid.o \
assert.o \
fflush.o \
setjmp.o \
asprintf.o \
vasprintf.o \
atoi.o \
gmtime_r.o \
__secs_to_tm.o \
fprintf.o \
fputc.o \
longjmp.o \
net.o \
file.o \
atexit.o \
tolower.o \
toupper.o \
islower.o \
isupper.o \
printf_wrapper.o \
mktime.o \
__errno_location.o \
ctime.o \
)
all: libcrt.a
install: all
cp libcrt.a $(PREFIX)
libcrt.a: $(OBJS)
ar rcs $@ $(OBJS)
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
%.o : %.s
$(CC) $(CFLAGS) -c -o $@ $<
clean:
@rm -f libcrt.a
@rm -f src/*.o