From 78ea2f6c20d6dbd88f4e8d639a0e8b66c42ca192 Mon Sep 17 00:00:00 2001 From: turbocat Date: Wed, 12 Jan 2022 18:22:13 +0000 Subject: [PATCH] Adde use_tcc.lua git-svn-id: svn://kolibrios.org@9623 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/use_tcc.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 programs/use_tcc.lua diff --git a/programs/use_tcc.lua b/programs/use_tcc.lua new file mode 100644 index 0000000000..4cf62be3cd --- /dev/null +++ b/programs/use_tcc.lua @@ -0,0 +1,19 @@ +TCC = "kos32-tcc-kx -B" .. tup.getcwd().. "/develop/ktcc/trunk/kx" + +CFLAGS = "-I" ..tup.getcwd().. "/develop/ktcc/trunk/libc.obj/include" +LFLAGS = "" +LIBS = "" + +OBJS = {} + +function compile_tcc(input, output) + if not output then output = '%B.o' end + tup.append_table(OBJS, + tup.foreach_rule(input, TCC .. " -c " .. CFLAGS .. " %f -o %o"), output + ) +end + +function link_tcc(input, output) + if not output then input,output = OBJS,input end + tup.rule(input, TCC .. " " .. CFLAGS .. " " .. LFLAGS .. " %f -o %o " .. LIBS .. " " .. tup.getconfig("KPACK_CMD"), output) +end