Subversion Repositories Kolibri OS

Rev

Rev 5123 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. if tup.getconfig("NO_GCC") ~= "" then return end
  2. FOLDERS = {
  3.   "ansi/assert",
  4.   "ansi/ctype",
  5.   "ansi/errno",
  6.   "ansi/locale",
  7.   "ansi/math",
  8.   "ansi/setjmp",
  9.   "ansi/stdio",
  10.   "ansi/stdlib",
  11.   "ansi/string",
  12.   "ansi/time",
  13.   "ansif",
  14.   "compat/bsd",
  15.   "compat/io",
  16.   "compat/math",
  17.   "compat/mman",
  18.   "compat/mntent",
  19.   "compat/search",
  20.   "compat/signal",
  21.   "compat/stdio",
  22.   "compat/stdlib",
  23.   "compat/string",
  24.   "compat/sys/resource",
  25.   "compat/sys/stat",
  26.   "compat/sys/vfs",
  27.   "compat/termios",
  28.   "compat/time",
  29.   "compat/unistd",
  30.   "compat/v1",
  31.   "crt0",
  32.   "dos/compat",
  33.   "dos/dir",
  34.   "dos/dos",
  35.   "dos/dos_emu",
  36.   "dos/errno",
  37.   "dos/io",
  38.   "dos/process",
  39.   "dos/sys/timeb",
  40.   "fsext",
  41.   "menuetos",
  42.   "net",
  43.   "pc_hw/cpu",
  44.   "pc_hw/endian",
  45.   "pc_hw/farptr",
  46.   "pc_hw/fpu",
  47.   "pc_hw/hwint",
  48.   "pc_hw/kb",
  49.   "pc_hw/mem",
  50.   "pc_hw/sound",
  51.   "pc_hw/timer",
  52.   "posix/dirent",
  53.   "posix/fcntl",
  54.   "posix/fnmatch",
  55.   "posix/glob",
  56.   "posix/grp",
  57. -- "posix/regex", -- not compilable
  58.   "posix/pwd",
  59.   "posix/setjmp",
  60.   "posix/signal",
  61.   "posix/stdio",
  62.   "posix/sys/stat",
  63.   "posix/sys/times",
  64.   "posix/sys/wait",
  65.   "posix/unistd",
  66.   "posix/utime",
  67.   "posix/utsname",
  68.   "termios",
  69. }
  70.  
  71. CFLAGS="-Os -fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-ident -fomit-frame-pointer -fno-asynchronous-unwind-tables -mpreferred-stack-boundary=2 -march=pentium-mmx -fgnu89-inline"
  72. OBJS={}
  73. for i,v in ipairs(FOLDERS) do
  74.   tup.append_table(OBJS,
  75.     tup.foreach_rule({v .. "/*.c", extra_inputs = {"../../config.h"}},
  76.       'kos32-gcc -c -I../../include -D__DEV_CONFIG_H=\\"../../config.h\\" ' .. CFLAGS .. " -o %o %f",
  77.       v .. "/%B.o")
  78.   )
  79.   tup.append_table(OBJS,
  80.     tup.foreach_rule({v .. "/*.s", extra_inputs = {"../../config.h"}},
  81.       'kos32-cpp -I../../include -D__DEV_CONFIG_H=\\"../../config.h\\" %f | kos32-as -o %o',
  82.       v .. "/%B.o")
  83.   )
  84. end
  85. tup.rule(OBJS, "kos32-ar rcs %o %f", {"../../lib/libc.a", "../../<libc>"})
  86.