Subversion Repositories Kolibri OS

Rev

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

  1. -- Do nothing unless explicitly requested in tup.config.
  2. build_type = tup.getconfig('BUILD_TYPE')
  3. if build_type == "" then
  4.   return
  5. end
  6.  
  7. --[================================[ DATA ]================================]--
  8.  
  9. PROGS = "../programs"
  10.  
  11. -- Static data that doesn't need to be compiled
  12. -- Files to be included in kolibri.img.
  13. -- The first subitem of every item is name inside kolibri.img, the second is name of local file.
  14. img_files = {
  15.  {"MACROS.INC", PROGS .. "/macros.inc"},
  16.  {"CONFIG.INC", PROGS .. "/config.inc"},
  17.  {"STRUCT.INC", PROGS .. "/struct.inc"},
  18.  {"FB2READ", "common/fb2read"},
  19.  {"ALLGAMES", "common/allgames"},
  20.  {"HOME.PNG", "common/wallpapers/home.png"},
  21.  {"ICONS32.PNG", "common/icons32.png"},
  22.  {"ICONS16.PNG", "common/icons16.png"},
  23.  {"INDEX.HTM", "common/index_htm"},
  24.  {"KUZKINA.MID", "common/kuzkina.mid"},
  25.  {"SINE.MP3", "common/sine.mp3"},
  26.  {"LANG.INC", build_type .. "/lang.inc"},
  27.  {"NOTIFY3.PNG", "common/notify3.png"},
  28.  {"UNIMG", PROGS .. "/fs/unimg/unimg"},
  29.  {"3D/HOUSE.3DS", "common/3d/house.3ds"},
  30.  {"File Managers/KFM2", "common/File Managers/kfm2"},
  31.  {"File Managers/ICONS.INI", "common/File Managers/icons.ini"},
  32.  {"File Managers/KFM.INI", "common/File Managers/kfm.ini"},
  33.  {"File Managers/FNAV/ABOUT.TXT", "common/File Managers/fNav/About.txt"},
  34.  {"File Managers/FNAV/FNAV", "common/File Managers/fNav/fNav.kex"},
  35.  {"File Managers/FNAV/FNAV.EXT", "common/File Managers/fNav/fnav.ext"},
  36.  {"File Managers/FNAV/FNAV.SET", "common/File Managers/fNav/fnav.set"},
  37.  {"File Managers/FNAV/FNAV_CUR.PNG", "common/File Managers/fNav/fnav_cur.png"},
  38.  {"File Managers/FNAV/FNAV_FNT.PNG", "common/File Managers/fNav/fnav_fnt.png"},
  39.  {"File Managers/FNAV/FNAV_ICN.PNG", "common/File Managers/fNav/fnav_icn.png"},
  40.  {"FONTS/TAHOMA.KF", "common/fonts/tahoma.kf"},
  41.  {"LIB/ICONV.OBJ", "common/lib/iconv.obj"},
  42.  {"LIB/KMENU.OBJ", "common/lib/kmenu.obj"},
  43.  {"LIB/NETCODE.OBJ", "common/lib/netcode.obj"},
  44.  {"LIB/PIXLIB.OBJ", "common/lib/pixlib.obj"},
  45.  {"MEDIA/IMGF/IMGF", "common/media/ImgF/ImgF"},
  46.  {"MEDIA/IMGF/CEDG.OBJ", "common/media/ImgF/cEdg.obj"},
  47.  {"MEDIA/IMGF/DITHER.OBJ", "common/media/ImgF/dither.obj"},
  48.  {"MEDIA/IMGF/INVSOL.OBJ", "common/media/ImgF/invSol.obj"},
  49.  {"MEDIA/PIXIESKN.PNG", PROGS .. "/cmm/pixie2/pixieskn.png"},
  50.  {"NETWORK/FTPC.INI", PROGS .. "/network/ftpc/ftpc.ini"},
  51.  {"NETWORK/FTPD.INI", "common/network/ftpd.ini"},
  52.  {"NETWORK/USERS.INI", "common/network/users.ini"},
  53.  {"NETWORK/FTPC_SYS.PNG", PROGS .. "/network/ftpc/ftpc_sys.png"},
  54.  {"NETWORK/FTPC_NOD.PNG", PROGS .. "/network/ftpc/ftpc_nod.png"},
  55.  {"SETTINGS/APP.INI", "common/settings/app.ini"},
  56.  {"SETTINGS/APP_PLUS.INI", "common/settings/app_plus.ini"},
  57.  {"SETTINGS/ASSOC.INI", "common/settings/assoc.ini"},
  58.  {"SETTINGS/AUTORUN.DAT", "common/settings/AUTORUN.DAT"},
  59.  {"SETTINGS/CEDIT.INI", PROGS .. "/develop/cedit/CEDIT.INI"},
  60.  {"SETTINGS/DOCKY.INI", "common/settings/docky.ini"},
  61.  {"SETTINGS/FB2READ.INI", "common/settings/fb2read.ini"},
  62.  {"SETTINGS/HOTANGLES.CFG", PROGS .. "/other/ha/SETTINGS/HOTANGLES.CFG"},
  63.  {"SETTINGS/ICON.INI", build_type .. "/settings/icon.ini"},
  64.  {"SETTINGS/KEYMAP.KEY", PROGS .. "/system/taskbar/trunk/KEYMAP.KEY"},
  65.  {"SETTINGS/KOLIBRI.LBL", build_type .. "/settings/kolibri.lbl"},
  66.  {"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"},
  67.  {"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"},
  68.  {"SETTINGS/NETWORK.INI", "common/settings/network.ini"},
  69.  {"SETTINGS/SYSTEM.INI", "common/settings/system.ini"},
  70.  {"SETTINGS/TASKBAR.INI", "common/settings/taskbar.ini"},
  71.  {"SETTINGS/weather.json", PROGS .. "/other/Weather/weather.json"},
  72. }
  73.  
  74. -- For russian build, add russian-only files.
  75. if build_type == "rus" then tup.append_table(img_files, {
  76.  {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"},
  77.  {"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy_ru"},
  78.  {"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"},
  79.  {"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"},
  80.  {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt"},
  81.  {"GAMES/DESCENT", build_type .. "/games/descent"},
  82.  {"SETTINGS/.shell", PROGS .. "/system/shell/bin/rus/.shell"},
  83.  {"SETTINGS/GAMES.INI", "rus/settings/games.ini"},
  84.  {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
  85.  {"SETTINGS/SYSPANEL.INI", "rus/settings/syspanel.ini"},
  86. }) elseif build_type == "eng" then tup.append_table(img_files, {
  87.  {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
  88.  {"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy"},
  89.  {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
  90.  {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
  91.  {"GAMES/DESCENT", "common/games/descent"},
  92.  {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
  93.  {"SETTINGS/GAMES.INI", "common/settings/games.ini"},
  94.  {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
  95.  {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
  96. }) elseif build_type == "sp" then tup.append_table(img_files, {
  97.  {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
  98.  {"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy"},
  99.  {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
  100.  {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
  101.  {"GAMES/DESCENT", "common/games/descent"},
  102.  {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
  103.  {"SETTINGS/GAMES.INI", "common/settings/games.ini"},
  104.  {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
  105.  {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
  106. }) elseif build_type == "it" then tup.append_table(img_files, {
  107.  {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
  108.  {"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy"},
  109.  {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
  110.  {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
  111.  {"GAMES/DESCENT", "common/games/descent"},
  112.  {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
  113.  {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"},
  114.  {"SETTINGS/GAMES.INI", "common/settings/games.ini"},
  115.  {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
  116. }) else tup.append_table(img_files, {
  117.  {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
  118.  {"DEVELOP/BACKY", PROGS .. "/develop/backy/Backy"},
  119.  {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
  120.  {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
  121.  {"GAMES/DESCENT", "common/games/descent"},
  122.  {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
  123.  {"SETTINGS/GAMES.INI", "common/settings/games.ini"},
  124.  {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
  125.  {"SETTINGS/SYSPANEL.INI", "common/settings/syspanel.ini"},
  126. }) end
  127.  
  128. --[[
  129. Files to be included in kolibri.iso and distribution kit outside of kolibri.img.
  130.  
  131. The first subitem of every item is name relative to the root of ISO or distribution kit,
  132. the second is name of local file.
  133.  
  134. If the first subitem ends in /, the last component of local file name is appended.
  135. The last component of the second subitem may contain '*'; if so, it will be expanded
  136. according to usual rules, but without matching directories.
  137.  
  138. Tup does not allow a direct dependency on a file that is generated in a directory
  139. other than where Tupfile.lua is and its children. Most files are generated
  140. in the directory with Tupfile.lua; for other files, the item should contain
  141. a named subitem "group=path/<groupname>" and the file should be put in <groupname>.
  142. --]]
  143. extra_files = {
  144.  {"/", "common/distr_data/autorun.inf"},
  145.  {"/", "common/distr_data/KolibriOS_icon.ico"},
  146.  {"Docs/stack.txt", "../kernel/trunk/docs/stack.txt"},
  147.  {"HD_Load/9x2klbr/", "common/HD_load/9x2klbr/LDKLBR.VXD"},
  148.  {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/AUTOEXEC.BAT"},
  149.  {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/CONFIG.SYS"},
  150.  {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/L_readme.txt"},
  151.  {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/L_readme_Win.txt"},
  152.  {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/vista_install.bat"},
  153.  {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/vista_remove.bat"},
  154.  {"HD_Load/", "common/HD_load/memdisk"},
  155.  {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot.rtf"},
  156.  {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot_866.txt"},
  157.  {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot_1251.txt"},
  158.  {"kolibrios/3D/info3ds/INFO3DS.INI", PROGS .. "/develop/info3ds/info3ds.ini"},
  159.  {"kolibrios/3D/info3ds/OBJECTS.PNG", PROGS .. "/develop/info3ds/objects.png"},
  160.  {"kolibrios/3D/info3ds/TOOLBAR.PNG", PROGS .. "/develop/info3ds/toolbar.png"},
  161.  {"kolibrios/3D/info3ds/FONT8X9.BMP", PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
  162.  {"kolibrios/3D/blocks/", PROGS .. "/bcc32/games/blocks/bin/*"},
  163.  {"kolibrios/3D/blocks/models/", PROGS .. "/bcc32/games/blocks/models/*"},
  164.  {"kolibrios/3D/md2view/", "common/3d/md2view/*"},
  165.  {"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"},
  166.  {"kolibrios/3D/voxel_editor/VOX_EDITOR.INI", PROGS .. "/media/voxel_editor/trunk/vox_editor.ini"},
  167.  {"kolibrios/3D/voxel_editor/HOUSE1.VOX", PROGS .. "/media/voxel_editor/trunk/house1.vox"},
  168.  {"kolibrios/3D/voxel_editor/HOUSE2.VOX", PROGS .. "/media/voxel_editor/trunk/house2.vox"},
  169.  {"kolibrios/3D/voxel_editor/SQUIRREL.VOX", PROGS .. "/media/voxel_editor/trunk/squirrel.vox"},
  170.  {"kolibrios/3D/voxel_utilites/VOX_MOVER.INI" , PROGS .. "/media/voxel_editor/utilites/vox_mover.ini"},
  171.  {"kolibrios/3D/FONT8X9.BMP", PROGS .. "/fs/kfar/trunk/font8x9.bmp"},
  172.  {"kolibrios/3D/TOOLB_1.PNG", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/toolb_1.png"},
  173.  {"kolibrios/3D/TEST_GLU1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/test_glu1"},
  174.  {"kolibrios/3D/TEST_GLU2", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/test_glu2"},
  175.  {"kolibrios/3D/TEXT_2.PNG", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/text_2.png"},
  176.  {"kolibrios/develop/c--/", PROGS .. "/cmm/c--/*"},
  177.  {"kolibrios/develop/fpc/", "common/develop/fpc/*"},
  178.  {"kolibrios/develop/fpc/examples/", PROGS .. "/develop/fp/examples/src/*"},
  179.  {"kolibrios/develop/fpc/examples/build.sh", "common/develop/fpc/build.sh"},
  180.  {"kolibrios/develop/oberon07/", PROGS .. "/develop/oberon07/*"},
  181.  {"kolibrios/develop/oberon07/doc/", PROGS .. "/develop/oberon07/doc/*"},
  182.  {"kolibrios/develop/oberon07/lib/KolibriOS/", PROGS .. "/develop/oberon07/lib/KolibriOS/*"},
  183.  {"kolibrios/develop/oberon07/samples/", PROGS .. "/develop/oberon07/samples/*"},
  184.  {"kolibrios/develop/tcc/", PROGS ..  "/develop/ktcc/trunk/*"},
  185. -- {"kolibrios/develop/tcc/", PROGS ..  "/develop/ktcc/trunk/bin/tcc"},
  186.  {"kolibrios/develop/tcc/lib/", PROGS ..  "/develop/ktcc/trunk/bin/lib/*"},
  187.  {"kolibrios/develop/tcc/include/", PROGS ..  "/develop/ktcc/trunk/libc.obj/include/*"},
  188.  {"kolibrios/develop/tcc/include/clayer/", PROGS ..  "/develop/ktcc/trunk/libc.obj/include/clayer/*"},
  189.  {"kolibrios/develop/tcc/include/cryptal/", PROGS .. "/develop/ktcc/trunk/libc.obj/include/cryptal/*"},
  190.  {"kolibrios/develop/tcc/include/sys/", PROGS .. "/develop/ktcc/trunk/libc.obj/include/sys/*"},
  191. -- {"kolibrios/develop/tcc/include/net/", PROGS ..  "/develop/ktcc/trunk/libc/include/net/*"},
  192. -- {"kolibrios/develop/tcc/include/tinygl/", PROGS ..  "/develop/ktcc/trunk/libc.obj/include/tinygl/*"},
  193.  {"kolibrios/develop/tcc/samples/", PROGS ..  "/develop/ktcc/trunk/libc.obj/samples/*.c"},
  194.  {"kolibrios/develop/tcc/samples/", PROGS ..  "/develop/ktcc/trunk/libc.obj/samples/*.sh"},
  195.  {"kolibrios/develop/tcc/samples/clayer/", PROGS ..  "/develop/ktcc/trunk/libc.obj/samples/clayer/*"},
  196. -- {"kolibrios/develop/tcc/samples/net/", PROGS ..  "/develop/ktcc/trunk/samples/net/*"},
  197. -- {"kolibrios/develop/tcc/samples/tinygl/", PROGS ..  "/develop/ktcc/trunk/samples/tinygl/*"},
  198.  {"kolibrios/emul/", "common/emul/*"},
  199.  {"kolibrios/emul/dosbox/", "common/emul/DosBox/*"},
  200.  {"kolibrios/emul/e80/readme.txt", PROGS .. "/emulator/e80/trunk/readme.txt"},
  201.  {"kolibrios/emul/e80/keyboard.png", PROGS .. "/emulator/e80/trunk/keyboard.png"},
  202.  {"kolibrios/emul/fceu/fceu", PROGS .. "/emulator/fceu/fceu"},
  203.  {"kolibrios/emul/fceu/FCEU ReadMe.txt", PROGS .. "/emulator/fceu/FCEU ReadMe.txt"},
  204.  {"kolibrios/emul/chip8/chip8", PROGS .. "/emulator/chip8/chip8"},
  205.  {"kolibrios/emul/chip8/readme.txt", PROGS .. "/emulator/chip8/readme.txt"},
  206.  {"kolibrios/emul/chip8/roms/", PROGS .. "/emulator/chip8/roms/*"},
  207.  {"kolibrios/emul/kwine/kwine", PROGS .. "/emulator/kwine/bin/kwine"},
  208.  {"kolibrios/emul/kwine/lib/", PROGS .. "/emulator/kwine/bin/lib/*"},
  209.  {"kolibrios/emul/uarm/", "common/emul/uarm/*"},
  210.  {"kolibrios/emul/zsnes/", "common/emul/zsnes/*"},
  211.  {"kolibrios/demos/ak47.lif", "common/demos/ak47.lif"},
  212.  {"kolibrios/demos/life2", "common/demos/life2"},
  213.  {"kolibrios/demos/relay.lif", "common/demos/relay.lif"},
  214.  {"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
  215.  {"kolibrios/games/BabyPainter", "common/games/BabyPainter"},
  216.  {"kolibrios/games/bomber/ackack.bmp", PROGS .. "/games/bomber/ackack.bmp"},
  217.  {"kolibrios/games/bomber/bomb.bmp", PROGS .. "/games/bomber/bomb.bmp"},
  218.  {"kolibrios/games/bomber/plane.bmp", PROGS .. "/games/bomber/plane.bmp"},
  219.  {"kolibrios/games/bomber/tile.bmp", PROGS .. "/games/bomber/tile.bmp"},
  220.  {"kolibrios/games/doom1/", "common/games/doom/*"},
  221.  {"kolibrios/games/fara/fara.gfx", "common/games/fara.gfx"},
  222.  {"kolibrios/games/jumpbump/", "common/games/jumpbump/*"},
  223.  {"kolibrios/games/knight", "common/games/knight"},
  224.  {"kolibrios/games/KosChess/", "common/games/KosChess/*"},
  225.  {"kolibrios/games/KosChess/images/", "common/games/KosChess/images/*"},
  226.  {"kolibrios/games/LaserTank/", "common/games/LaserTank/*"},
  227.  {"kolibrios/games/lrl/", "common/games/lrl/*"},
  228.  {"kolibrios/games/mun/data/", "common/games/mun/data/*"},
  229.  {"kolibrios/games/mun/libc.dll", "common/games/mun/libc.dll"},
  230.  {"kolibrios/games/mun/mun", "common/games/mun/mun"},
  231.  {"kolibrios/games/pig/", "common/games/pig/*"},
  232.  {"kolibrios/games/soko/", "common/games/soko/*"},
  233.  {"kolibrios/games/fridge/", "common/games/fridge/*"},
  234.  {"kolibrios/games/the_bus/menu.png", PROGS .. "/cmm/the_bus/menu.png"},
  235.  {"kolibrios/games/the_bus/objects.png", PROGS .. "/cmm/the_bus/objects.png"},
  236.  {"kolibrios/games/the_bus/road.png", PROGS .. "/cmm/the_bus/road.png"},
  237.  {"kolibrios/grafx2/fonts/", "common/media/grafx2/fonts/*"},
  238.  {"kolibrios/grafx2/scripts/", "common/media/grafx2/scripts/libs/*"},
  239.  {"kolibrios/grafx2/scripts/libs/", "common/media/grafx2/scripts/*"},
  240.  {"kolibrios/grafx2/skins/", "common/media/grafx2/skins/*"},
  241.  {"kolibrios/grafx2/", "common/media/grafx2/*"},
  242.  {"kolibrios/speech/", "common/media/speech/*"},
  243.  {"kolibrios/drivers/drvinf.ini", "common/drivers/drvinf.ini"},
  244.  {"kolibrios/drivers/ahci/", "common/drivers/ahci/*"},
  245.  {"kolibrios/drivers/acpi/", "common/drivers/acpi/*"},
  246.  {"kolibrios/drivers/atikms/", "common/drivers/atikms/*"},
  247.  {"kolibrios/drivers/i915/", "common/drivers/i915/*"},
  248.  {"kolibrios/drivers/test/", "common/drivers/test/*"},
  249.  {"kolibrios/drivers/vmware/", "common/drivers/vmware/*"},
  250.  {"kolibrios/KolibriNext/", "common/KolibriNext/*"},
  251.  {"kolibrios/KolibriNext/settings/", "common/KolibriNext/settings/*"},
  252.  {"kolibrios/lib/avcodec-56.dll", "common/lib/avcodec-56.dll"},
  253.  {"kolibrios/lib/avdevice-56.dll", "common/lib/avdevice-56.dll"},
  254.  {"kolibrios/lib/avformat-56.dll", "common/lib/avformat-56.dll"},
  255.  {"kolibrios/lib/swscale-3.dll", "common/lib/swscale-3.dll"},
  256.  {"kolibrios/lib/avutil-54.dll", "common/lib/avutil-54.dll"},
  257.  {"kolibrios/lib/cairo2.dll", "common/lib/cairo2.dll"},
  258.  {"kolibrios/lib/freetype.dll", "common/lib/freetype.dll"},
  259.  {"kolibrios/lib/i965-video.dll", "common/lib/i965-video.dll"},
  260.  {"kolibrios/lib/libdrm.dll", "common/lib/libdrm.dll"},
  261.  {"kolibrios/lib/libegl.dll", "common/lib/libegl.dll"},
  262.  {"kolibrios/lib/libeglut.dll", "common/lib/libeglut.dll"},
  263.  {"kolibrios/lib/libGL.dll", "common/lib/libGL.dll"},
  264.  {"kolibrios/lib/libjpeg.dll", "common/lib/libjpeg.dll"},
  265.  {"kolibrios/lib/libpng16.dll", "common/lib/libpng16.dll"},
  266.  {"kolibrios/lib/libva.dll", "common/lib/libva.dll"},
  267.  {"kolibrios/lib/libz.dll", "common/lib/libz.dll"},
  268.  {"kolibrios/lib/osmesa.dll", "common/lib/osmesa.dll"},
  269.  {"kolibrios/lib/pixlib-gl.dll", "common/lib/pixlib-gl.dll"},
  270.  {"kolibrios/lib/pixman-1.dll", "common/lib/pixman-1.dll"},
  271.  {"kolibrios/lib/swresample-1.dll", "common/lib/swresample-1.dll"},
  272.  {"kolibrios/lib/i915_dri.drv", "common/lib/i915_dri.drv"},
  273.  {"kolibrios/media/fplay", "common/media/fplay"},
  274.  {"kolibrios/media/fplay_run", "common/media/fplay_run"},
  275.  {"kolibrios/media/minimp3", "common/media/minimp3"},
  276.  {"kolibrios/media/updf", "common/media/updf"},
  277.  {"kolibrios/media/vttf", "common/media/vttf"},
  278.  {"kolibrios/media/beat/Beat", PROGS .. "/media/Beat/Beat"},
  279.  {"kolibrios/media/beat/Beep1.raw", PROGS .. "/media/Beat/Beep1.raw"},
  280.  {"kolibrios/media/beat/Beep2.raw", PROGS .. "/media/Beat/Beep2.raw"},
  281.  {"kolibrios/media/beat/PlayNote", PROGS .. "/media/Beat/PlayNote/PlayNote"},
  282.  {"kolibrios/media/beat/Readme-en.txt", PROGS .. "/media/Beat/Readme-en.txt"},
  283.  {"kolibrios/media/beat/Readme-ru.txt", PROGS .. "/media/Beat/Readme-ru.txt"},
  284.  {"kolibrios/media/zsea/zsea.ini", PROGS .. "/media/zsea/zSea.ini"},
  285.  {"kolibrios/media/zsea/buttons/buttons.png", PROGS .. "/media/zsea/buttons.png"},
  286.  {"kolibrios/netsurf/netsurf", "common/network/netsurf/netsurf"},
  287.  {"kolibrios/netsurf/res/", "common/network/netsurf/res/*"},
  288.  {"kolibrios/res/skins/", "../skins/authors.txt"},
  289.  {"kolibrios/res/templates/", "common/templates/*"},
  290.  {"kolibrios/res/templates/", PROGS .. "/emulator/e80/trunk/games/*"},
  291.  {"kolibrios/res/templates/NES/", "common/templates/NES/*"},
  292.  {"kolibrios/res/wallpapers/", "common/wallpapers/*"},
  293.  {"kolibrios/res/system/", build_type .. "/settings/kolibri.lbl"},
  294.  {"kolibrios/utils/cnc_editor/cnc_editor", PROGS .. "/other/cnc_editor/cnc_editor"},
  295.  {"kolibrios/utils/cnc_editor/kolibri.NC", PROGS .. "/other/cnc_editor/kolibri.NC"},
  296.  {"kolibrios/utils/vmode", "common/vmode"},
  297.  {"kolibrios/utils/texture", "common/utils/texture"},
  298.  {"kolibrios/utils/t_edit.ini", PROGS .. "/other/t_edit/t_edit.ini"},
  299.  {"kolibrios/utils/info/ASM.SYN", PROGS .. "/other/t_edit/info/asm.syn"},
  300.  {"kolibrios/utils/info/CPP_CLA.SYN", PROGS .. "/other/t_edit/info/cpp_kol_cla.syn"},
  301.  {"kolibrios/utils/info/CPP_DAR.SYN", PROGS .. "/other/t_edit/info/cpp_kol_dar.syn"},
  302.  {"kolibrios/utils/info/CPP_DEF.SYN", PROGS .. "/other/t_edit/info/cpp_kol_def.syn"},
  303.  {"kolibrios/utils/info/DEFAULT.SYN", PROGS .. "/other/t_edit/info/default.syn"},
  304.  {"kolibrios/utils/info/HTML.SYN", PROGS .. "/other/t_edit/info/html.syn"},
  305.  {"kolibrios/utils/info/INI.SYN", PROGS .. "/other/t_edit/info/ini_files.syn"},
  306.  }
  307. if build_type == "rus" then tup.append_table(extra_files, {
  308.  {"Docs/cp866/config.txt", build_type .. "/docs/CONFIG.TXT"},
  309.  {"Docs/cp866/gnu.txt", build_type .. "/docs/GNU.TXT"},
  310.  {"Docs/cp866/history.txt", build_type .. "/docs/HISTORY.TXT"},
  311.  {"Docs/cp866/hot_keys.txt", build_type .. "/docs/HOT_KEYS.TXT"},
  312.  {"Docs/cp866/install.txt", build_type .. "/docs/INSTALL.TXT"},
  313.  {"Docs/cp866/readme.txt", build_type .. "/docs/README.TXT"},
  314.  {"Docs/cp866/sysfuncr.txt", PROGS .. "/system/docpack/trunk/SYSFUNCR.TXT"},
  315.  {"Docs/cp1251/config.txt", build_type .. "/docs/CONFIG.WIN.TXT", cp1251_from = build_type .. "/docs/CONFIG.TXT"},
  316.  {"Docs/cp1251/gnu.txt", build_type .. "/docs/GNU.WIN.TXT", cp1251_from = build_type .. "/docs/GNU.TXT"},
  317.  {"Docs/cp1251/history.txt", build_type .. "/docs/HISTORY.WIN.TXT", cp1251_from = build_type .. "/docs/HISTORY.TXT"},
  318.  {"Docs/cp1251/hot_keys.txt", build_type .. "/docs/HOT_KEYS.WIN.TXT", cp1251_from = build_type .. "/docs/HOT_KEYS.TXT"},
  319.  {"Docs/cp1251/install.txt", build_type .. "/docs/INSTALL.WIN.TXT", cp1251_from = build_type .. "/docs/INSTALL.TXT"},
  320.  {"Docs/cp1251/readme.txt", build_type .. "/docs/README.WIN.TXT", cp1251_from = build_type .. "/docs/README.TXT"},
  321.  {"Docs/cp1251/sysfuncr.txt", build_type .. "/docs/SYSFUNCR.WIN.TXT", cp1251_from = PROGS .. "/system/docpack/trunk/SYSFUNCR.TXT"},
  322.  {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme_dos.txt"},
  323.  {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme_win.txt"},
  324.  {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/install.txt"},
  325.  {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/readme.txt"},
  326.  {"kolibrios/games/ataka", "common/games/ataka/ataka_ru"},
  327.  {"kolibrios/games/Dungeons/Resources/Textures/Environment/", PROGS .. "/games/Dungeons/Resources/Textures/Environment/*"},
  328.  {"kolibrios/games/Dungeons/Resources/Textures/Objects/", PROGS .. "/games/Dungeons/Resources/Textures/Objects/*"},
  329.  {"kolibrios/games/Dungeons/Resources/Textures/HUD/", PROGS .. "/games/Dungeons/Resources/Textures/HUD/*"},
  330.  {"kolibrios/games/Dungeons/Resources/Textures/", PROGS .. "/games/Dungeons/Resources/Textures/Licenses.txt"},
  331.  {"kolibrios/games/Dungeons/", PROGS .. "/games/Dungeons/readme_ru.txt"},
  332.  {"kolibrios/games/sstartrek/SStarTrek", "common/games/sstartrek/SStarTrek_ru"},
  333.  {"kolibrios/games/WHOWTBAM/", build_type .. "/games/whowtbam"},
  334.  {"kolibrios/games/WHOWTBAM/", build_type .. "/games/appdata.dat"},
  335.  {"kolibrios/media/zsea/zsea_keys.txt", PROGS .. "/media/zsea/Docs/zSea_keys_rus.txt"},
  336.  {"kolibrios/res/guide/", build_type .. "/docs/guide/*"},
  337. }) else tup.append_table(extra_files, {
  338.  {"Docs/config.txt", build_type .. "/docs/CONFIG.TXT"},
  339.  {"Docs/copying.txt", build_type .. "/docs/COPYING.TXT"},
  340.  {"Docs/hot_keys.txt", build_type .. "/docs/HOT_KEYS.TXT"},
  341.  {"Docs/install.txt", build_type .. "/docs/INSTALL.TXT"},
  342.  {"Docs/readme.txt", build_type .. "/docs/README.TXT"},
  343.  {"Docs/sysfuncs.txt", PROGS .. "/system/docpack/trunk/SYSFUNCS.TXT"},
  344.  {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme.txt"},
  345.  {"HD_Load/mtldr/install.txt", PROGS .. "/hd_load/mtldr/install_eng.txt"},
  346.  {"HD_Load/USB_Boot/readme.txt", PROGS .. "/hd_load/usb_boot/readme_eng.txt"},
  347.  {"kolibrios/games/ataka", "common/games/ataka/ataka_en"},
  348.  {"kolibrios/games/sstartrek/SStarTrek", "common/games/sstartrek/SStarTrek_en"},
  349.  {"kolibrios/media/zsea/zsea_keys.txt", PROGS .. "/media/zsea/Docs/zSea_keys_eng.txt"},
  350. }) end
  351. --[[
  352. Files to be included in distribution kit outside of kolibri.img, but not kolibri.iso.
  353. Same syntax as extra_files.
  354. ]]--
  355. if build_type == "rus" then
  356. distr_extra_files = {
  357.  {"/readme_dos.txt", build_type .. "/distr_data/readme_dos_distr.txt"},
  358.  {"/readme.txt", build_type .. "/distr_data/readme_distr.txt", cp1251_from = build_type .. "/distr_data/readme_dos_distr.txt"},
  359. }
  360. else
  361. distr_extra_files = {
  362.  {"/readme.txt", build_type .. "/distr_data/readme_distr.txt"},
  363. }
  364. end
  365. --[[
  366. Files to be included in kolibri.iso outside of kolibri.img, but not distribution kit.
  367. Same syntax as extra_files.
  368. ]]--
  369. if build_type == "rus" then
  370. iso_extra_files = {
  371.  {"/readme_dos.txt", build_type .. "/distr_data/readme_dos.txt"},
  372.  {"/readme.txt", build_type .. "/distr_data/readme.txt", cp1251_from = build_type .. "/distr_data/readme_dos.txt"},
  373. }
  374. else
  375. iso_extra_files = {
  376.  {"/readme.txt", build_type .. "/distr_data/readme.txt"},
  377. }
  378. end
  379.  
  380. -- Programs that require FASM to compile.
  381. if tup.getconfig('NO_FASM') ~= 'full' then
  382. tup.append_table(img_files, {
  383.  {"KERNEL.MNT", "../kernel/trunk/kernel.mnt"},
  384.  {"@DOCKY", PROGS .. "/system/docky/trunk/docky"},
  385.  {"@HOTANGLES", PROGS .. "/other/ha/HOTANGLES"},
  386.  {"@ICON", PROGS .. "/system/icon_new/icon"},
  387.  {"@MENU", PROGS .. "/system/menu/trunk/menu"},
  388.  {"@NOTIFY", PROGS .. "/system/notify3/notify"},
  389.  {"@OPEN", PROGS .. "/system/open/open"},
  390.  {"@TASKBAR", PROGS .. "/system/taskbar/trunk/TASKBAR"},
  391.  {"@SS", PROGS .. "/system/scrsaver/scrsaver"},
  392.  {"@VOLUME", PROGS .. "/media/volume/volume"},
  393.  {"HACONFIG", PROGS .. "/other/ha/HACONFIG"},
  394.  {"APM", PROGS .. "/system/apm/apm"},
  395.  {"CALC", PROGS .. "/other/calc/trunk/calc"},
  396.  {"CALENDAR", PROGS .. "/system/calendar/trunk/calendar"},
  397.  {"COLRDIAL", PROGS .. "/system/colrdial/color_dialog"},
  398.  {"CROPFLAT", PROGS .. "/system/cropflat/cropflat"},
  399.  {"CPU", PROGS .. "/system/cpu/trunk/cpu"},
  400.  {"CPUID", PROGS .. "/testing/cpuid/trunk/CPUID"},
  401.  {"DOCPACK", PROGS .. "/system/docpack/trunk/docpack"},
  402.  {"DEFAULT.SKN", "../skins/Leency/Shkvorka/Shkvorka.skn"},
  403.  {"DISPTEST", PROGS .. "/testing/disptest/trunk/disptest"},
  404.  {"END", PROGS .. "/system/end/light/end"},
  405.  {"ESKIN", PROGS .. "/system/eskin/trunk/eskin"},
  406.  {"FSPEED", PROGS .. "/testing/fspeed/fspeed"},
  407.  {"GMON", PROGS .. "/system/gmon/gmon"},
  408.  {"HDD_INFO", PROGS .. "/system/hdd_info/trunk/hdd_info"},
  409.  {"KBD", PROGS .. "/testing/kbd/trunk/kbd"},
  410.  {"KPACK", PROGS .. "/other/kpack/trunk/kpack"},
  411.  {"LAUNCHER", PROGS .. "/system/launcher/trunk/launcher"},
  412.  {"LOADDRV", PROGS .. "/system/loaddrv/loaddrv"},
  413.  {"MAGNIFY", PROGS .. "/demos/magnify/trunk/magnify"},
  414.  {"MGB", PROGS .. "/testing/mgb/trunk/mgb"},
  415.  {"MOUSEMUL", PROGS .. "/system/mousemul/trunk/mousemul"},
  416.  {"MADMOUSE", PROGS .. "/other/madmouse/madmouse"},
  417.  {"MYKEY", PROGS .. "/system/MyKey/trunk/MyKey"},
  418.  {"PCIDEV", PROGS .. "/testing/pcidev/trunk/PCIDEV"},
  419.  {"RDSAVE", PROGS .. "/system/rdsave/trunk/rdsave"},
  420.  {"RTFREAD", PROGS .. "/other/rtfread/trunk/rtfread"},
  421.  {"SEARCHAP", PROGS .. "/system/searchap/searchap"},
  422.  {"SCRSHOOT", PROGS .. "/media/scrshoot/scrshoot"},
  423.  {"SETUP", PROGS .. "/system/setup/trunk/setup"},
  424.  {"SKINCFG", PROGS .. "/system/skincfg/trunk/skincfg"},
  425.  {"TERMINAL", PROGS .. "/system/terminal/terminal"},
  426.  {"TEST", PROGS .. "/testing/protection/trunk/test"},
  427.  {"TINYPAD", PROGS .. "/develop/tinypad/trunk/tinypad"},
  428.  {"UNZ", PROGS .. "/fs/unz/unz"},
  429.  {"ZKEY", PROGS .. "/system/zkey/trunk/ZKEY"},
  430.  {"3D/3DWAV", PROGS .. "/demos/3dwav/trunk/3dwav"},
  431.  {"3D/CROWNSCR", PROGS .. "/demos/crownscr/trunk/crownscr"},
  432.  {"3D/3DCUBE2", PROGS .. "/demos/3dcube2/trunk/3DCUBE2"},
  433.  {"3D/FREE3D04", PROGS .. "/demos/free3d04/trunk/free3d04"},
  434.  {"3D/GEARS", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/gears"},
  435.  {"3D/RAY", PROGS .. "/demos/ray/ray"},
  436.  {"3D/VIEW3DS", PROGS .. "/demos/view3ds/view3ds"},
  437.  {"DEMOS/BCDCLK", PROGS .. "/demos/bcdclk/trunk/bcdclk"},
  438.  {"DEMOS/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"},
  439.  {"DEMOS/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"},
  440.  {"DEMOS/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"},
  441.  {"DEMOS/EYES", PROGS .. "/demos/eyes/trunk/eyes"},
  442.  {"DEMOS/FIREWORK", PROGS .. "/demos/firework/trunk/firework"},
  443.  {"DEMOS/MOVBACK", PROGS .. "/demos/movback/trunk/movback"},
  444.  {"DEMOS/PLASMA", PROGS .. "/demos/plasma/trunk/plasma"},
  445.  {"DEMOS/SPIRAL", PROGS .. "/demos/spiral/spiral"},
  446.  {"DEMOS/TINYFRAC", PROGS .. "/demos/tinyfrac/trunk/tinyfrac"},
  447.  {"DEMOS/TRANTEST", PROGS .. "/demos/trantest/trunk/trantest"},
  448.  {"DEMOS/TUBE", PROGS .. "/demos/tube/trunk/tube"},
  449.  {"DEMOS/UNVWATER", PROGS .. "/demos/unvwater/trunk/unvwater"},
  450.  {"DEMOS/WEB", PROGS .. "/demos/web/trunk/web"},
  451.  {"DEVELOP/ASCIIVJU", PROGS .. "/develop/asciivju/trunk/asciivju"},
  452.  {"DEVELOP/BOARD", PROGS .. "/system/board/trunk/board"},
  453.  {"DEVELOP/CEDIT", PROGS .. "/develop/cedit/CEDIT"},
  454.  {"DEVELOP/COBJ", PROGS .. "/develop/cObj/trunk/cObj"},
  455.  {"DEVELOP/ENTROPYVIEW", PROGS .. "/develop/entropyview/entropyview"},
  456.  {"DEVELOP/FASM", PROGS .. "/develop/fasm/1.73/fasm"},
  457.  {"DEVELOP/H2D2B", PROGS .. "/develop/h2d2b/trunk/h2d2b"},
  458.  {"DEVELOP/HEED", PROGS .. "/develop/heed/trunk/heed"},
  459.  {"DEVELOP/KEYASCII", PROGS .. "/develop/keyascii/trunk/keyascii"},
  460.  {"DEVELOP/MTDBG", PROGS .. "/develop/mtdbg/mtdbg"},
  461.  {"DEVELOP/SCANCODE", PROGS .. "/develop/scancode/trunk/scancode"},
  462.  {"DEVELOP/EXAMPLES/CONGET", PROGS .. "/develop/libraries/console_coff/examples/test_gets"},
  463.  {"DEVELOP/EXAMPLES/THREAD", PROGS .. "/develop/examples/thread/trunk/thread"},
  464.  {"DEVELOP/EXAMPLES/USE_MB", PROGS .. "/demos/use_mb/use_mb"},
  465.  {"File Managers/KFAR", PROGS .. "/fs/kfar/trunk/kfar"},
  466.  {"File Managers/KFM", PROGS .. "/fs/kfm/trunk/kfm"},
  467.  {"File Managers/OPENDIAL", PROGS .. "/fs/opendial/opendial"},
  468.  {"GAMES/15", PROGS .. "/games/15/trunk/15"},
  469.  {"GAMES/FREECELL", PROGS .. "/games/freecell/freecell"},
  470.  {"GAMES/GOMOKU", PROGS .. "/games/gomoku/trunk/gomoku"},
  471.  {"GAMES/LIGHTS", PROGS .. "/games/sq_game/trunk/SQ_GAME"},
  472.  {"GAMES/LINES", PROGS .. "/games/lines/lines"},
  473.  {"GAMES/MSQUARE", PROGS .. "/games/MSquare/trunk/MSquare"},
  474.  {"GAMES/PIPES", PROGS .. "/games/pipes/pipes"},
  475.  {"GAMES/PONG", PROGS .. "/games/pong/trunk/pong"},
  476.  {"GAMES/PONG3", PROGS .. "/games/pong3/trunk/pong3"},
  477.  {"GAMES/RSQUARE", PROGS .. "/games/rsquare/trunk/rsquare"},
  478.  {"GAMES/SNAKE", PROGS .. "/games/snake/trunk/snake"},
  479.  {"GAMES/SUDOKU", PROGS .. "/games/sudoku/trunk/sudoku"},
  480.  {"GAMES/SW", PROGS .. "/games/sw/trunk/sw"},
  481.  {"GAMES/TANKS", PROGS .. "/games/tanks/trunk/tanks"},
  482.  {"GAMES/TETRIS", PROGS .. "/games/tetris/trunk/tetris"},
  483.  {"LIB/ARCHIVER.OBJ", PROGS .. "/fs/kfar/trunk/kfar_arc/kfar_arc.obj"},
  484.  {"LIB/BOX_LIB.OBJ", PROGS .. "/develop/libraries/box_lib/trunk/box_lib.obj"},
  485.  {"LIB/BUF2D.OBJ", PROGS .. "/develop/libraries/buf2d/trunk/buf2d.obj"},
  486.  {"LIB/CONSOLE.OBJ", PROGS .. "/develop/libraries/console_coff/console.obj"},
  487.  {"LIB/CNV_PNG.OBJ", PROGS .. "/media/zsea/plugins/png/cnv_png.obj"},
  488.  {"LIB/DLL.OBJ", PROGS .. "/develop/libraries/dll/dll.obj"},
  489.  {"LIB/HTTP.OBJ", PROGS .. "/develop/libraries/http/http.obj"},
  490.  {"LIB/LIBGFX.OBJ", PROGS .. "/develop/libraries/libs-dev/libgfx/libgfx.obj"},
  491.  {"LIB/LIBIMG.OBJ", PROGS .. "/develop/libraries/libs-dev/libimg/libimg.obj"},
  492.  {"LIB/LIBINI.OBJ", PROGS .. "/develop/libraries/libs-dev/libini/libini.obj"},
  493.  {"LIB/LIBIO.OBJ", PROGS .. "/develop/libraries/libs-dev/libio/libio.obj"},
  494.  {"LIB/MSGBOX.OBJ", PROGS .. "/develop/libraries/msgbox/msgbox.obj"},
  495.  {"LIB/NETWORK.OBJ", PROGS .. "/develop/libraries/network/network.obj"},
  496.  {"LIB/PROC_LIB.OBJ", PROGS .. "/develop/libraries/proc_lib/trunk/proc_lib.obj"},
  497.  {"LIB/RASTERWORKS.OBJ", PROGS .. "/develop/libraries/fontRasterWorks(unicode)/RasterWorks.obj"},
  498.  {"LIB/SORT.OBJ", PROGS .. "/develop/libraries/sorter/sort.obj"},
  499.  {"LIB/TINYGL.OBJ", PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
  500.  {"LIB/MTAR.OBJ", PROGS .. "/develop/libraries/microtar/mtar.obj"},
  501.  {"MEDIA/ANIMAGE", PROGS .. "/media/animage/trunk/animage"},
  502.  {"MEDIA/KIV", PROGS .. "/media/kiv/trunk/kiv"},
  503.  {"MEDIA/LISTPLAY", PROGS .. "/media/listplay/trunk/listplay"},
  504.  {"MEDIA/MIDAMP", PROGS .. "/media/midamp/trunk/midamp"},
  505.  {"MEDIA/MP3INFO", PROGS .. "/media/mp3info/mp3info"},
  506.  {"MEDIA/PALITRA", PROGS .. "/media/palitra/trunk/palitra"},
  507.  {"MEDIA/PIANO", PROGS .. "/media/piano/piano"},
  508.  {"MEDIA/STARTMUS", PROGS .. "/media/startmus/trunk/STARTMUS"},
  509.  {"NETWORK/PING", PROGS .. "/network/ping/ping"},
  510.  {"NETWORK/NETCFG", PROGS .. "/network/netcfg/netcfg"},
  511.  {"NETWORK/NETSTAT", PROGS .. "/network/netstat/netstat"},
  512.  {"NETWORK/NSINST", PROGS .. "/network/netsurf/nsinstall"},
  513.  {"NETWORK/NSLOOKUP", PROGS .. "/network/nslookup/nslookup"},
  514.  {"NETWORK/PASTA", PROGS .. "/network/pasta/pasta"},
  515.  {"NETWORK/SYNERGYC", PROGS .. "/network/synergyc/synergyc"},
  516.  {"NETWORK/SNTP", PROGS .. "/network/sntp/sntp"},
  517.  {"NETWORK/TELNET", PROGS .. "/network/telnet/telnet"},
  518.  {"NETWORK/@ZEROCONF", PROGS .. "/network/zeroconf/zeroconf"},
  519.  {"NETWORK/FTPC", PROGS .. "/network/ftpc/ftpc"},
  520.  {"NETWORK/FTPD", PROGS .. "/network/ftpd/ftpd"},
  521.  {"NETWORK/TFTPC", PROGS .. "/network/tftpc/tftpc"},
  522.  {"NETWORK/IRCC", PROGS .. "/network/ircc/ircc"},
  523.  {"NETWORK/DOWNLOADER", PROGS .. "/network/downloader/downloader"},
  524.  {"NETWORK/VNCC", PROGS .. "/network/vncc/vncc"},
  525.  {"DRIVERS/VIDINTEL.SYS", "../drivers/video/vidintel.sys"},
  526.  {"DRIVERS/3C59X.SYS", "../drivers/ethernet/3c59x.sys"},
  527.  {"DRIVERS/AR81XX.SYS", "../drivers/ethernet/ar81xx.sys"},
  528.  {"DRIVERS/DEC21X4X.SYS", "../drivers/ethernet/dec21x4x.sys"},
  529.  {"DRIVERS/FORCEDETH.SYS", "../drivers/ethernet/forcedeth.sys"},
  530.  {"DRIVERS/I8254X.SYS", "../drivers/ethernet/i8254x.sys"},
  531.  {"DRIVERS/I8255X.SYS", "../drivers/ethernet/i8255x.sys"},
  532.  {"DRIVERS/MTD80X.SYS", "../drivers/ethernet/mtd80x.sys"},
  533.  {"DRIVERS/PCNET32.SYS", "../drivers/ethernet/pcnet32.sys"},
  534.  {"DRIVERS/R6040.SYS", "../drivers/ethernet/R6040.sys"},
  535.  {"DRIVERS/RHINE.SYS", "../drivers/ethernet/rhine.sys"},
  536.  {"DRIVERS/RTL8029.SYS", "../drivers/ethernet/RTL8029.sys"},
  537.  {"DRIVERS/RTL8139.SYS", "../drivers/ethernet/RTL8139.sys"},
  538.  {"DRIVERS/RTL8169.SYS", "../drivers/ethernet/RTL8169.sys"},
  539.  {"DRIVERS/SIS900.SYS", "../drivers/ethernet/sis900.sys"},
  540.  {"DRIVERS/UHCI.SYS", "../drivers/usb/uhci.sys"},
  541.  {"DRIVERS/OHCI.SYS", "../drivers/usb/ohci.sys"},
  542.  {"DRIVERS/EHCI.SYS", "../drivers/usb/ehci.sys"},
  543.  {"DRIVERS/USBHID.SYS", "../drivers/usb/usbhid/usbhid.sys"},
  544.  {"DRIVERS/USBSTOR.SYS", "../drivers/usb/usbstor.sys"},
  545.  {"DRIVERS/RDC.SYS", "../drivers/video/rdc.sys"},
  546.  {"DRIVERS/COMMOUSE.SYS", "../drivers/mouse/commouse.sys"},
  547.  {"DRIVERS/PS2MOUSE.SYS", "../drivers/mouse/ps2mouse4d/trunk/ps2mouse.sys"},
  548.  {"DRIVERS/TMPDISK.SYS", "../drivers/disk/tmpdisk.sys"},
  549.  {"DRIVERS/intel_hda.sys", "../drivers/audio/intel_hda/intel_hda.sys"},
  550.  {"DRIVERS/SB16.SYS", "../drivers/audio/sb16/sb16.sys"},
  551.  {"DRIVERS/SOUND.SYS", "../drivers/audio/sound.sys"},
  552.  {"DRIVERS/INFINITY.SYS", "../drivers/audio/infinity/infinity.sys"},
  553.  {"DRIVERS/INTELAC97.SYS", "../drivers/audio/intelac97.sys"},
  554.  {"DRIVERS/EMU10K1X.SYS", "../drivers/audio/emu10k1x.sys"},
  555.  {"DRIVERS/FM801.SYS", "../drivers/audio/fm801.sys"},
  556.  {"DRIVERS/VT823X.SYS", "../drivers/audio/vt823x.sys"},
  557.  {"DRIVERS/SIS.SYS", "../drivers/audio/sis.sys"},
  558. })
  559. tup.append_table(extra_files, {
  560.  {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/9x2klbr.exe"},
  561.  {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/MeOSload.com"},
  562.  {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/mtldr"},
  563.  {"HD_Load/", PROGS .. "/hd_load/mtldr_install/mtldr_install.exe"},
  564.  {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/BOOT_F32.BIN"},
  565.  {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/MTLD_F32"},
  566.  {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/inst.exe"},
  567.  {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/setmbr.exe"},
  568.  {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/MeOSload.com"},
  569.  {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/enable.exe"},
  570.  {"kolibrios/3D/3dsheart", PROGS .. "/demos/3dsheart/trunk/3dsheart"},
  571.  {"kolibrios/3D/flatwav", PROGS .. "/demos/flatwav/trunk/flatwav"},
  572.  {"kolibrios/3D/mos3de", PROGS .. "/demos/mos3de/mos3de"},
  573.  {"kolibrios/3D/info3ds/INFO3DS", PROGS .. "/develop/info3ds/info3ds"},
  574.  {"kolibrios/3D/textures1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"},
  575.  {"kolibrios/3D/info3ds/INFO3DS_U", PROGS .. "/develop/info3ds/info3ds_u"},
  576.  {"kolibrios/3D/voxel_editor/VOXEL_EDITOR", PROGS .. "/media/voxel_editor/trunk/voxel_editor"},
  577.  {"kolibrios/3D/voxel_utilites/VOX_CREATOR" , PROGS .. "/media/voxel_editor/utilites/vox_creator"},
  578.  {"kolibrios/3D/voxel_utilites/VOX_MOVER" , PROGS .. "/media/voxel_editor/utilites/vox_mover"},
  579.  {"kolibrios/3D/voxel_utilites/VOX_TGL" , PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
  580.  {"kolibrios/demos/buddhabrot", PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
  581.  {"kolibrios/demos/life3", PROGS .. "/games/life3/trunk/life3"},
  582.  {"kolibrios/demos/qjulia", PROGS .. "/demos/qjulia/trunk/qjulia"},
  583.  {"kolibrios/games/Almaz", PROGS .. "/games/almaz/almaz"},
  584.  {"kolibrios/games/arcanii", PROGS .. "/games/arcanii/trunk/arcanii"},
  585.  {"kolibrios/games/bomber/bomber", PROGS .. "/games/bomber/bomber"},
  586.  {"kolibrios/games/bomber/bomberdata.bin", PROGS .. "/games/bomber/sounds/bomberdata.bin"},
  587.  {"kolibrios/games/codemaster/binary_master", PROGS .. "/games/codemaster/binary_master"},
  588.  {"kolibrios/games/codemaster/hang_programmer", PROGS .. "/games/codemaster/hang_programmer"},
  589.  {"kolibrios/games/codemaster/kolibri_puzzle", PROGS .. "/games/codemaster/kolibri_puzzle"},
  590.  {"kolibrios/games/megamaze", PROGS .. "/games/megamaze/trunk/megamaze"},
  591.  {"kolibrios/games/invaders", PROGS .. "/games/invaders/invaders"},
  592.  {"kolibrios/games/phenix", PROGS .. "/games/phenix/trunk/phenix"},
  593.  {"kolibrios/games/soko/soko", PROGS .. "/games/soko/trunk/SOKO"},
  594.  {"kolibrios/media/img_transform", PROGS .. "/media/img_transform/img_transform"},
  595.  {"kolibrios/media/zsea/zsea", PROGS .. "/media/zsea/zSea"},
  596.  {"kolibrios/media/zsea/plugins/cnv_bmp.obj", PROGS .. "/media/zsea/plugins/bmp/cnv_bmp.obj"},
  597.  {"kolibrios/media/zsea/plugins/cnv_gif.obj", PROGS .. "/media/zsea/plugins/gif/cnv_gif.obj"},
  598.  {"kolibrios/media/zsea/plugins/cnv_jpeg.obj", PROGS .. "/media/zsea/plugins/jpeg/cnv_jpeg.obj"},
  599.  {"kolibrios/media/zsea/plugins/convert.obj", PROGS .. "/media/zsea/plugins/convert/convert.obj"},
  600.  {"kolibrios/media/zsea/plugins/rotate.obj", PROGS .. "/media/zsea/plugins/rotate/rotate.obj"},
  601.  {"kolibrios/media/zsea/plugins/scaling.obj", PROGS .. "/media/zsea/plugins/scaling/scaling.obj"},
  602.  {"kolibrios/utils/calcplus", PROGS .. "/other/calcplus/calcplus"},
  603.  {"kolibrios/utils/t_edit", PROGS .. "/other/t_edit/t_edit"},
  604. })
  605. -- For russian build, add russian-only programs.
  606. if build_type == "rus" then tup.append_table(img_files, {
  607.  {"PERIOD", PROGS .. "/other/period/trunk/period"},
  608.  {"GAMES/KLAVISHA", PROGS .. "/games/klavisha/trunk/klavisha"},
  609.  {"DEVELOP/EXAMPLES/TESTCON2", PROGS .. "/develop/libraries/console_coff/examples/testcon2_rus"},
  610. }) else tup.append_table(img_files, {
  611.  {"DEVELOP/TESTCON2", PROGS .. "/develop/libraries/console_coff/examples/testcon2_eng"},
  612. }) end
  613.  
  614. if build_type == "rus" then tup.append_table(extra_files, {
  615.  {"kolibrios/games/Dungeons/Dungeons", PROGS .. "/games/Dungeons/Dungeons"},
  616. }) end
  617.  
  618. end -- tup.getconfig('NO_FASM') ~= 'full'
  619.  
  620. -- Programs that require NASM to compile.
  621. if tup.getconfig('NO_NASM') ~= 'full' then
  622. tup.append_table(img_files, {
  623.  {"ACLOCK", PROGS .. "/demos/aclock/trunk/aclock"},
  624.  {"LOD", PROGS .. "/fs/lod/lod"},
  625.  {"TIMER", PROGS .. "/other/Timer/timer"},
  626.  {"TINFO", PROGS .. "/system/tinfo/tinfo"},
  627.  {"DEVELOP/MSTATE", PROGS .. "/develop/mstate/mstate"},
  628.  {"GAMES/C4", PROGS .. "/games/c4/trunk/c4"},
  629.  {"MEDIA/FILLSCR", PROGS .. "/media/FillScr/fillscr"},
  630. })
  631. tup.append_table(extra_files, {
  632.  {"kolibrios/develop/utils/GenFiles", PROGS .. "/testing/genfiles/GenFiles"},
  633. })
  634. end -- tup.getconfig('NO_NASM') ~= 'full'
  635.  
  636. -- Programs that require JWASM to compile.
  637. if tup.getconfig('NO_JWASM') ~= 'full' then
  638. tup.append_table(img_files, {
  639.  {"RUN", PROGS .. "/system/RunOD/1/RUN"},
  640.  {"LIB/INPUTBOX.OBJ", PROGS .. "/develop/libraries/InputBox/INPUTBOX.OBJ"},
  641. })
  642. end -- tup.getconfig('NO_JWASM') ~= 'full'
  643.  
  644. -- Programs that require C-- to compile.
  645. if tup.getconfig('NO_CMM') ~= 'full' then
  646. tup.append_table(img_files, {
  647.  {"APP_PLUS", PROGS .. "/cmm/app_plus/app_plus.com"},
  648.  {"EASYSHOT", PROGS .. "/cmm/misc/easyshot.com"},
  649.  {"MOUSECFG", PROGS .. "/cmm/mousecfg/mousecfg.com"},
  650.  {"BARSCFG", PROGS .. "/cmm/barscfg/barscfg.com"},
  651.  {"SYSPANEL", PROGS .. "/cmm/misc/software_widget.com"},
  652.  {"SYSMON", PROGS .. "/cmm/sysmon/sysmon.com"},
  653.  {"QUARK", PROGS .. "/cmm/quark/quark.com"},
  654.  {"TMPDISK", PROGS .. "/cmm/tmpdisk/tmpdisk.com"},
  655.  {"DEVELOP/CLIPVIEW", PROGS .. "/cmm/clipview/clipview.com"},
  656.  {"DEVELOP/MENU", PROGS .. "/cmm/menu/menu.com"},
  657.  {"DEVELOP/PIPET", PROGS .. "/cmm/misc/pipet.com"},
  658.  {"File Managers/EOLITE", PROGS .. "/cmm/eolite/Eolite.com"},
  659.  {"KF_VIEW", PROGS .. "/cmm/kf_font_viewer/font_viewer.com"},
  660.  {"GAMES/CLICKS", PROGS .. "/games/clicks/trunk/clicks.com"},
  661.  {"GAMES/MBLOCKS", PROGS .. "/cmm/misc/mblocks.com"},
  662.  {"DEVELOP/DIFF", PROGS .. "/cmm/diff/diff.com"},
  663.  {"GAMES/FindNumbers", PROGS .. "/games/FindNumbers/trunk/FindNumbers"},
  664.  {"GAMES/FLOOD-IT", PROGS .. "/games/flood-it/trunk/flood-it.com"},
  665.  {"GAMES/MINE", PROGS .. "/games/mine/trunk/mine"},
  666.  {"MEDIA/PIXIE", PROGS .. "/cmm/pixie2/pixie.com"},
  667.  {"MEDIA/ICONEDIT", PROGS .. "/cmm/iconedit/iconedit.com"},
  668.  {"NETWORK/DL", PROGS .. "/cmm/downloader/dl.com"},
  669.  {"NETWORK/WEBVIEW", PROGS .. "/cmm/browser/WebView.com"},
  670. })
  671. tup.append_table(extra_files, {
  672.  {"kolibrios/drivers/drvinst.kex", PROGS .. "/cmm/drvinst/drvinst.com"},
  673.  {"kolibrios/drivers/acpi/install.kex", PROGS .. "/cmm/misc/acpi_install.com"},
  674.  {"kolibrios/games/pig/pigex", PROGS .. "/cmm/examples/pigex.com"},
  675.  {"kolibrios/games/the_bus/the_bus", PROGS .. "/cmm/the_bus/the_bus.com"},
  676.  {"kolibrios/KolibriNext/install.kex", PROGS .. "/cmm/misc/install.com"},
  677.  {"kolibrios/utils/appearance", PROGS .. "/cmm/appearance/appearance.com"},
  678.  {"kolibrios/utils/dicty.kex", PROGS .. "/cmm/dicty/dicty.com"},
  679.  {"kolibrios/utils/notes", PROGS .. "/cmm/notes/notes.com"},
  680. })
  681. end -- tup.getconfig('NO_CMM') ~= 'full'
  682.  
  683. -- Programs that require MSVC to compile.
  684. if tup.getconfig('NO_MSVC') ~= 'full' then
  685. tup.append_table(img_files, {
  686.  {"GRAPH", PROGS .. "/other/graph/graph"},
  687.  {"TABLE", PROGS .. "/other/table/table"},
  688.  {"MEDIA/AC97SND", PROGS .. "/media/ac97snd/ac97snd.bin"},
  689.  {"GAMES/KOSILKA", PROGS .. "/games/kosilka/kosilka"},
  690.  {"GAMES/RFORCES", PROGS .. "/games/rforces/trunk/rforces"},
  691.  {"GAMES/XONIX", PROGS .. "/games/xonix/trunk/xonix"},
  692. })
  693. tup.append_table(extra_files, {
  694.  {"kolibrios/games/fara/fara", PROGS .. "/games/fara/trunk/fara"},
  695.  {"kolibrios/games/LaserTank/LaserTank", PROGS .. "/games/LaserTank/trunk/LaserTank"},
  696. })
  697. end -- tup.getconfig('NO_MSVC') ~= 'full'
  698.  
  699. -- Programs that require TCC to compile.
  700. if tup.getconfig('NO_TCC') ~= 'full' then
  701. tup.append_table(img_files, {
  702.  {"NETWORK/WHOIS", PROGS .. "/network/whois/whois"},
  703.  {"SHELL", PROGS .. "/system/shell/shell"},
  704. -- {"NETWORK/WEATHER", PROGS .. "/other/Weather/weather"},
  705. })
  706. tup.append_table(extra_files, {
  707.  {"kolibrios/utils/thashview", PROGS .. "/other/TinyHashView/thashview"},
  708.  {"kolibrios/develop/TinyBasic/", PROGS .. "/develop/tinybasic/TinyBasic"},
  709.  {"kolibrios/develop/TinyBasic/", PROGS .. "/develop/tinybasic/TBuserMan.txt"},
  710.  {"kolibrios/utils/teatool", PROGS .. "/other/TEAtool/teatool"},
  711.  {"kolibrios/utils/passwordgen", PROGS .. "/other/PasswordGen/passwordgen"},
  712.  {"kolibrios/utils/kruler", PROGS .. "/other/kruler/kruler"},
  713.  {"kolibrios/media/qr_tool", PROGS .. "/media/qr_tool/qr_tool"},
  714.  {"kolibrios/utils/weather", PROGS .. "/other/Weather/weather"},
  715. })
  716. end -- tup.getconfig('NO_TCC') ~= 'full'
  717.  
  718. -- Programs that require GCC to compile.
  719. if tup.getconfig('NO_GCC') ~= 'full' then
  720. tup.append_table(img_files, {
  721.  {"GAMES/REVERSI", PROGS .. "/games/reversi/trunk/reversi"},
  722.  {"LIB/LIBC.OBJ", PROGS .. "/develop/ktcc/trunk/libc.obj/source/libc.obj"},
  723. })
  724. tup.append_table(extra_files, {
  725. -- {"kolibrios/3D/cubeline", PROGS .. "/demos/cubeline/trunk/cubeline"},
  726.  {"kolibrios/emul/e80/e80", PROGS .. "/emulator/e80/trunk/e80"},
  727.  {"kolibrios/emul/uarm/", "../contrib/other/uarm/uARM"},
  728.  {"kolibrios/games/2048", PROGS .. "/games/2048/2048"},
  729.  {"kolibrios/games/donkey", PROGS .. "/games/donkey/donkey"},
  730.  {"kolibrios/games/heliothryx", PROGS .. "/games/heliothryx/heliothryx"},
  731.  {"kolibrios/games/marblematch3", PROGS .. "/games/marblematch3/marblematch3"},
  732.  {"kolibrios/games/nsider", PROGS .. "/games/nsider/nsider"},
  733.  {"kolibrios/games/quake/", "common/games/quake/*"}, -- not really gcc, but no sense without sdlquake
  734.  {"kolibrios/games/quake/", "../contrib/other/sdlquake-1.0.9/sdlquake"},
  735.  {"kolibrios/games/fridge/", PROGS .. "/games/fridge/fridge"},
  736.  {"kolibrios/games/", PROGS .. "/games/checkers/trunk/checkers"},
  737.  {"kolibrios/games/wolf3d/", "../contrib/games/wolf3d/wolf3d"},
  738.  {"kolibrios/games/wolf3d/", "common/games/wolf3d/*"},
  739.  {"kolibrios/develop/lua/lua", "../contrib/other/lua-5.2.0/lua"},
  740.  {"kolibrios/develop/lua/calc.lua", "../contrib/other/lua-5.2.0/calc.lua"},
  741.  {"kolibrios/develop/lua/console.lua", "../contrib/other/lua-5.2.0/console.lua"},
  742.  {"kolibrios/lib/libc.dll", "../contrib/sdk/bin/libc.dll", group = "../contrib/sdk/lib/<libc.dll.a>"},
  743.  {"kolibrios/utils/minizip/minizip", PROGS .. "/fs/minizip/minizip"},
  744.  {"kolibrios/utils/minizip/miniunz", PROGS .. "/fs/minizip/miniunz"},
  745.  {"kolibrios/develop/tcc/tcc", PROGS .. "/develop/ktcc/trunk/source/tcc"},
  746. })
  747. -- For russian build, add russian-only programs.
  748. if build_type == "rus" then tup.append_table(extra_files, {
  749.  {"kolibrios/games/21days", PROGS .. "/games/21days/21days"},
  750. }) end
  751. end -- tup.getconfig('NO_GCC') ~= 'full'
  752.  
  753. -- Skins.
  754. tup.include("../skins/skinlist.lua")
  755.  
  756. --[================================[ CODE ]================================]--
  757. -- expand extra_files and similar
  758. function expand_extra_files(files)
  759.   local result = {}
  760.   for i,v in ipairs(files) do
  761.     if string.match(v[2], "%*")
  762.     then
  763.       local g = tup.glob(v[2])
  764.       for j,x in ipairs(g) do
  765.         table.insert(result, {v[1], x, group=v.group})
  766.       end
  767.     else
  768.       if v.cp1251_from then
  769.         tup.definerule{inputs = {v.cp1251_from}, command = 'iconv -f cp866 -t cp1251 "%f" > "%o"', outputs = {v[2]}}
  770.       end
  771.       table.insert(result, {v[1], v[2], group=v.group})
  772.     end
  773.   end
  774.   return result
  775. end
  776.  
  777. -- append skins to extra_files
  778. for i,v in ipairs(skinlist) do
  779.   table.insert(extra_files, {"kolibrios/res/skins/", "../skins/" .. v})
  780. end
  781.  
  782. -- prepare distr_extra_files and iso_extra_files: expand and append common part
  783. extra_files = expand_extra_files(extra_files)
  784. distr_extra_files = expand_extra_files(distr_extra_files)
  785. iso_extra_files = expand_extra_files(iso_extra_files)
  786. tup.append_table(distr_extra_files, extra_files)
  787. tup.append_table(iso_extra_files, extra_files)
  788.  
  789. -- generate list of directories to be created inside kolibri.img
  790. img_dirs = {}
  791. input_deps = {}
  792. for i,v in ipairs(img_files) do
  793.   img_file = v[1]
  794.   local_file = v[2]
  795.  
  796.   slash_pos = 0
  797.   while true do
  798.     slash_pos = string.find(img_file, '/', slash_pos + 1)
  799.     if not slash_pos then break end
  800.     table.insert(img_dirs, string.sub(img_file, 1, slash_pos - 1))
  801.   end
  802.  
  803.   -- tup does not want to see hidden files as dependencies
  804.   if not string.match(local_file, "/%.") then
  805.     table.insert(input_deps, v.group or local_file)
  806.   end
  807. end
  808.  
  809. -- create empty 1.44M file
  810. make_img_command = '^ MKIMG kolibri.img^ ' -- for tup: don't write full command to logs
  811. make_img_command = make_img_command .. "dd if=/dev/zero of=kolibri.img count=2880 bs=512 2>&1"
  812. -- format it as a standard 1.44M floppy
  813. make_img_command = make_img_command .. " && mformat -f 1440 -i kolibri.img ::"
  814. -- copy bootloader
  815. if tup.getconfig("NO_FASM") ~= "full" then
  816. bootloader = "../kernel/trunk/bootloader/boot_fat12.bin"
  817. make_img_command = make_img_command .. " && dd if=" .. bootloader .. " of=kolibri.img count=1 bs=512 conv=notrunc 2>&1"
  818. table.insert(input_deps, bootloader)
  819. end
  820. -- make folders
  821. table.sort(img_dirs)
  822. for i,v in ipairs(img_dirs) do
  823.   if v ~= img_dirs[i-1] then
  824.     make_img_command = make_img_command .. ' && mmd -i kolibri.img "::' .. v .. '"'
  825.   end
  826. end
  827. -- copy files
  828. output_deps = {"kolibri.img"}
  829. for i,v in ipairs(img_files) do
  830.   local_file = v[2]
  831.   if v[1] == "KERNEL.MNT" and tup.getconfig("INSERT_REVISION_ID") ~= ""
  832.   then
  833.     -- for kernel.mnt, insert autobuild revision identifier
  834.     -- from .revision to .kernel.mnt
  835.     -- note that .revision and .kernel.mnt must begin with .
  836.     -- to prevent tup from tracking them
  837.     if build_type == "rus"
  838.     then str='$(LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(get-current-revision)]"|iconv -f utf8 -t cp866)'
  839.     else str='$(date -u +"[auto-build %d %b %Y %R, r$(get-current-revision)]")'
  840.     end
  841.     str = string.gsub(str, "%$", "\\$") -- escape $ as \$
  842.     str = string.gsub(str, "%%", "%%%%") -- escape % as %%
  843.     make_img_command = make_img_command .. " && cp " .. local_file .. " .kernel.mnt"
  844.     make_img_command = make_img_command .. " && str=" .. str
  845.     make_img_command = make_img_command .. ' && echo -n $str | dd of=.kernel.mnt bs=1 seek=`expr 279 - length "$str"` conv=notrunc 2>/dev/null'
  846.     local_file = ".kernel.mnt"
  847.     table.insert(output_deps, local_file)
  848.   end
  849.   make_img_command = make_img_command .. ' && mcopy -moi kolibri.img "' .. local_file .. '" "::' .. v[1] .. '"'
  850. end
  851.  
  852. -- generate tup rule for kolibri.img
  853. tup.definerule{inputs = input_deps, command = make_img_command, outputs = output_deps}
  854.  
  855. -- generate command and dependencies for mkisofs
  856. input_deps = {"kolibri.img"}
  857. iso_files_list = ""
  858. for i,v in ipairs(iso_extra_files) do
  859.   iso_files_list = iso_files_list .. ' "' .. v[1] .. '=' .. v[2] .. '"'
  860.   table.insert(input_deps, v.group or v[2])
  861. end
  862.  
  863. -- generate tup rule for kolibri.iso
  864. if tup.getconfig("INSERT_REVISION_ID") ~= ""
  865. then volume_id = "KolibriOS r`cat .revision`"
  866. else volume_id = "KolibriOS"
  867. end
  868. tup.definerule{inputs = input_deps, command =
  869.   '^ MKISOFS kolibri.iso^ ' .. -- for tup: don't write full command to logs
  870.   'mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points ' ..
  871.   '-A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "' .. volume_id .. '" -sysid "KOLIBRI" ' ..
  872.   '-iso-level 3 -o kolibri.iso kolibri.img' .. iso_files_list .. ' 2>&1',
  873.   outputs = {"kolibri.iso"}}
  874.  
  875. -- generate command and dependencies for distribution kit
  876. cp = 'cp "%f" "%o"'
  877. tup.definerule{inputs = {"kolibri.img"}, command = cp, outputs = {"distribution_kit/kolibri.img"}}
  878. for i,v in ipairs(distr_extra_files) do
  879.   cmd = cp:gsub("%%f", v[2]) -- input can be a group, we can't rely on tup's expansion of %f in this case
  880.   if string.sub(v[1], -1) == "/"
  881.   then tup.definerule{inputs = {v.group or v[2]}, command = cmd, outputs = {"distribution_kit/" .. v[1] .. tup.file(v[2])}}
  882.   else tup.definerule{inputs = {v.group or v[2]}, command = cmd, outputs = {"distribution_kit/" .. v[1]}}
  883.   end
  884. end
  885.  
  886. -- build kolibri.raw
  887. raw_mbr = "../programs/hd_load/usb_boot/mbr"
  888. raw_bootsector = "../kernel/trunk/bootloader/extended_primary_loader/fat32/bootsect.bin"
  889. raw_files = {
  890.  {"KOLIBRI.IMG", "kolibri.img"},
  891.  {"KORDLDR.F32", "../kernel/trunk/bootloader/extended_primary_loader/fat32/kordldr.f32"},
  892.  {"KERNEL.MNT", "../kernel/trunk/kernel.mnt.ext_loader"},
  893.  {"CONFIG.INI", "../kernel/trunk/bootloader/extended_primary_loader/config.ini"},
  894.  {"EFI/BOOT/BOOTX64.EFI", "../kernel/trunk/bootloader/uefi4kos/bootx64.efi"},
  895.  {"EFI/BOOT/BOOTIA32.EFI", "../kernel/trunk/bootloader/uefi4kos/bootia32.efi"},
  896.  {"EFI/KOLIBRIOS/KOLIBRI.IMG", "kolibri.img"},
  897.  {"EFI/KOLIBRIOS/KOLIBRI.INI", "../kernel/trunk/bootloader/uefi4kos/kolibri.ini"},
  898.  {"EFI/KOLIBRIOS/KOLIBRI.KRN", "../kernel/trunk/kolibri.krn"}
  899. }
  900.  
  901. for i,v in ipairs(img_files) do
  902.   raw_file = "KOLIBRIOS/" .. string.upper(v[1])
  903.   local_file = v[2]
  904.   tup.append_table(raw_files, {{raw_file, local_file}})
  905. end
  906.  
  907. tup.append_table(raw_files, extra_files)
  908.  
  909. make_raw_command = '^ MKIMG kolibri.raw^ ' -- for tup: don't write full command to logs
  910. make_raw_command = make_raw_command .. "dd if=/dev/zero of=kolibri.raw bs=1MiB count=128 2>&1"
  911. make_raw_command = make_raw_command .. " && parted --script kolibri.raw mktable gpt"
  912. make_raw_command = make_raw_command .. " && parted --script kolibri.raw unit MiB mkpart primary fat32 1 127"
  913. make_raw_command = make_raw_command .. " && parted --script kolibri.raw set 1 esp on"
  914. make_raw_command = make_raw_command .. " && sgdisk kolibri.raw --hybrid 1:EE"
  915. make_raw_command = make_raw_command .. " && dd if=" .. raw_mbr .. " of=kolibri.raw bs=1 count=\\$((0x1b8)) conv=notrunc"
  916. make_raw_command = make_raw_command .. " && dd if=" .. raw_mbr .. " of=kolibri.raw bs=1 count=1 skip=\\$((0x5a)) seek=\\$((0x1be)) conv=notrunc"
  917. make_raw_command = make_raw_command .. " && mformat -i kolibri.raw@@1M -v KOLIBRIOS -T \\$(((128-1-1)*1024*1024/512)) -h 16 -s 32 -H 2048 -c 1 -F -B " .. raw_bootsector .. " ::"
  918.  
  919. -- generate list of directories to be created inside kolibri.raw
  920. raw_dirs = {}
  921. input_deps = {raw_mbr, raw_bootsector}
  922. for i,v in ipairs(raw_files) do
  923.   raw_file = v[1]
  924.   local_file = v[2]
  925.  
  926.   if raw_file ~= "/" then
  927.     slash_pos = 0
  928.     while true do
  929.       slash_pos = string.find(raw_file, '/', slash_pos + 1)
  930.       if not slash_pos then break end
  931.       table.insert(raw_dirs, string.sub(raw_file, 1, slash_pos - 1))
  932.     end
  933.   end
  934.  
  935.   -- tup does not want to see hidden files as dependencies
  936.   if not string.match(local_file, "/%.") then
  937.     table.insert(input_deps, v.group or local_file)
  938.   end
  939. end
  940.  
  941. -- img_files and extra_files have some common dirs with different case
  942. for i,d in ipairs(raw_dirs) do
  943.   raw_dirs[i] = string.upper(raw_dirs[i])
  944. end
  945.  
  946. -- make folders
  947. table.sort(raw_dirs)
  948. for i,v in ipairs(raw_dirs) do
  949.   if v ~= raw_dirs[i-1] then
  950.     make_raw_command = make_raw_command .. ' && mmd -i kolibri.raw@@1M "::' .. v .. '"'
  951.   end
  952. end
  953.  
  954. -- copy files
  955. for i,v in ipairs(raw_files) do
  956.   local_file = v[2]
  957.   make_raw_command = make_raw_command .. ' && mcopy -moi kolibri.raw@@1M "' .. local_file .. '" "::' .. v[1] .. '"'
  958. end
  959.  
  960. -- generate tup rule for kolibri.raw
  961. tup.definerule{inputs = input_deps, command = make_raw_command, outputs = {"kolibri.raw"}}
  962.