2022-04-20 21:07:54 +02:00
|
|
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
2021-04-27 18:33:31 +02:00
|
|
|
if tup.getconfig("NO_GCC") ~= "" then return end
|
2021-06-10 16:40:17 +02:00
|
|
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../../../../" or tup.getconfig("HELPERDIR")
|
2021-04-27 18:33:31 +02:00
|
|
|
tup.include(HELPERDIR .. "/use_gcc.lua")
|
|
|
|
|
2022-04-20 21:07:54 +02:00
|
|
|
CFLAGS = " -c -nostdinc -DGNUC -D_BUILD_LIBC -Os -fno-common -fno-builtin -fno-leading-underscore -fno-pie"
|
2021-04-27 18:33:31 +02:00
|
|
|
INCLUDES = " -I../include"
|
|
|
|
|
2022-04-20 21:07:54 +02:00
|
|
|
OBJS = {"math/tan.obj", "math/sqrt.obj"}
|
|
|
|
|
|
|
|
for _, OBJ in pairs(OBJS) do
|
|
|
|
tup.rule(string.gsub(OBJ, ".obj", ".asm"), "fasm %f %o ", OBJ)
|
|
|
|
end
|
|
|
|
|
|
|
|
tup.rule("libc.c", "kos32-gcc" .. CFLAGS .. INCLUDES .. " -o %o %f ", "libc_tmp.obj")
|
|
|
|
|
|
|
|
table.insert(OBJS, "libc_tmp.obj");
|
|
|
|
tup.rule(OBJS, "clink -o %o %f" .. " && kos32-strip %o --strip-unneeded " .. tup.getconfig("KPACK_CMD"), "libc.obj");
|