libc.obj: now builded to kos32-tcc

git-svn-id: svn://kolibrios.org@9843 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2022-06-19 15:47:00 +00:00
parent 18b9adeee2
commit 4f75a74c2c
8 changed files with 63 additions and 69 deletions

View File

@@ -3,16 +3,45 @@ if tup.getconfig("NO_GCC") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../../../" or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_gcc.lua")
CFLAGS = " -c -nostdinc -DGNUC -D_BUILD_LIBC -Os -fno-common -fno-builtin -fno-leading-underscore -fno-pie"
CFLAGS = " -r -nostdinc -nostdlib -DGNUC -D_BUILD_LIBC "
INCLUDES = " -I../include"
OBJS = {"math/tan.obj", "math/sqrt.obj"}
GAS_SRC = {
"setjmp/setjmp.s",
"setjmp/longjmp.s",
"math/round.s",
"math/atan.s",
"math/pow2.s",
"math/log10.s",
"math/exp.s",
"math/pow10.s",
"math/log.s",
"math/pow.s",
"math/ceil.s",
"math/cos.s",
"math/sin.s",
"math/asin.s",
"math/modf.s",
"math/floor.s",
"math/fabs.s",
"math/fmod.s",
"math/log2.s",
"math/acos.s",
"math/modfl.s",
"math/atan2.s",
"math/sqrt.s",
"math/tan.s",
"string/memset.s",
"string/memmove.s"
}
for _, OBJ in pairs(OBJS) do
tup.rule(string.gsub(OBJ, ".obj", ".asm"), "fasm %f %o ", OBJ)
end
OBJS = {}
tup.rule("libc.c", "kos32-gcc" .. CFLAGS .. INCLUDES .. " -o %o %f ", "libc_tmp.obj")
tup.append_table(OBJS,
tup.foreach_rule(GAS_SRC, "as --32 %f -o %o", "%B.o")
)
table.insert(OBJS, "libc_tmp.obj");
tup.rule(OBJS, "clink -o %o %f" .. " && kos32-strip %o --strip-unneeded " .. tup.getconfig("KPACK_CMD"), "libc.obj");
table.insert(OBJS, "libc.c");
tup.rule(OBJS, "kos32-tcc" .. CFLAGS .. INCLUDES .. " -o %o %f " .. " && strip %o --strip-unneeded " , "libc.o")
tup.rule("libc.o", "objconv -fcoff32 %f %o " .. tup.getconfig("KPACK_CMD"), "%B.obj")