Subversion Repositories Kolibri OS

Rev

Rev 5098 | Rev 8828 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5098 Rev 8827
Line 1... Line 1...
1
if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("NO_GCC") ~= "" then return end
1
if tup.getconfig("NO_TCC") ~= "" then return end
2
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
-
 
3
tup.include(HELPERDIR .. "/use_gcc.lua")
-
 
4
LDFLAGS = LDFLAGS .. " -T kolibri.ld"
-
 
5
-- compile shell
-
 
6
if tup.getconfig("LANG") == "ru"
-
 
7
then C_LANG = "LANG_RUS"
-
 
8
else C_LANG = "LANG_ENG" -- this includes default case without config
-
 
9
end
-
 
Line 10... Line -...
10
 
-
 
11
if tup.getconfig("TUP_PLATFORM") == "win32"
-
 
12
-- on win32 '#' is not a special character, but backslash and quotes would be printed as is
-
 
13
then tup.rule('echo #define ' .. C_LANG .. ' 1 > %o', {"lang.h"})
2
 
14
-- on unix '#' should be escaped
3
TCC="kos32-tcc"
15
else tup.rule('echo "#define" ' .. C_LANG .. ' 1 > %o', {"lang.h"})
-
 
16
end
-
 
17
tup.append_table(OBJS, tup.rule("start.asm", "fasm %f %o", "start.o"))
4
CFLAGS  = "-I../../develop/ktcc/trunk/libc.obj/include"
18
compile_gcc{"shell.c", "system/kolibri.c", "system/stdlib.c", "system/string.c", "system/ctype.c", extra_inputs = {"lang.h"}}
-
 
Line 19... Line 5...
19
link_gcc("shell")
5
LDFLAGS = "-nostdlib ../../develop/ktcc/trunk/bin/lib/crt0.o -L../../develop/ktcc/trunk/bin/lib"
20
 
6
 
21
-- compile ASM test
-
 
-
 
7
LIBS = "-ltcc -lc.obj"
22
tup.rule("test.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "asmtest")
8
COMMAND=string.format("%s %s %s %s %s", TCC, CFLAGS, LDFLAGS , "%f -o %o",  LIBS)
23
-- compile C test
-
 
24
OBJS = {"start.o", "kolibri.o", "stdlib.o", "string.o", "ctype.o"} -- remove shell.o
-
 
25
compile_gcc{"test.c"}
9