49 lines
826 B
Python
49 lines
826 B
Python
import sys
|
|
|
|
Import('env')
|
|
|
|
libc_env = env.Clone()
|
|
|
|
src = [ ]
|
|
|
|
src_common = [
|
|
"abort.c",
|
|
"assert.c",
|
|
"core/mutex.c",
|
|
"dir.c",
|
|
"exit.c",
|
|
"file.c",
|
|
"malloc.c",
|
|
"printf.c",
|
|
"process.c",
|
|
"posix/mman.c",
|
|
"posix/pthread.c",
|
|
"stdlib.c",
|
|
"string.c",
|
|
"syscall.c",
|
|
"time.c",
|
|
]
|
|
|
|
src_amd64 = [
|
|
"amd64/syscall.S",
|
|
]
|
|
|
|
src_arm64 = [
|
|
"arm64/syscall.S",
|
|
]
|
|
|
|
if (env["ARCH"] == "amd64"):
|
|
src.append(src_amd64)
|
|
elif (env["ARCH"] == "arm64"):
|
|
src.append(src_arm64)
|
|
src.append(src_common)
|
|
|
|
libc_env.Append(CPPFLAGS = ['-nostdinc', "-Wno-sign-compare"])
|
|
libc_env.Append(CPPPATH = ['#build/include'])
|
|
|
|
libc_env.StaticLibrary("libc", src)
|
|
libc_env.StaticObject("crt1", "crt1.c")
|
|
libc_env.StaticObject("crti", "${ARCH}/crti.S")
|
|
libc_env.StaticObject("crtn", "${ARCH}/crtn.S")
|
|
|