Subversion Repositories Kolibri OS

Rev

Rev 5334 | Rev 5336 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5098 clevermous 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
 {"DEVELOP/TE_ICON.PNG", PROGS .. "/other/t_edit/te_icon.png"},
19
 {"DEVELOP/TL_NOD_16.PNG", PROGS .. "/other/t_edit/tl_nod_16.png"},
20
 {"DEVELOP/TL_SYS_16.PNG", PROGS .. "/media/log_el/trunk/tl_sys_16.png"},
21
 {"DEVELOP/T_EDIT.INI", PROGS .. "/other/t_edit/t_edit.ini"},
22
 {"File Managers/Z_ICONS.PNG", PROGS .. "/fs/opendial/z_icons.png"},
23
 {"File Managers/BUTTONS.BMP", PROGS .. "/fs/kfm/trunk/buttons.bmp"},
24
 {"File Managers/ICONS.BMP", PROGS .. "/fs/kfm/trunk/icons.bmp"},
25
 {"FONTS/LITT.CHR", PROGS .. "/demos/bgitest/trunk/FONTS/LITT.CHR"},
26
 {"GAMES/SNAKE.INI", PROGS .. "/games/snake/trunk/snake.ini"},
27
 {"MEDIA/KIV.INI", PROGS .. "/media/kiv/trunk/kiv.ini"},
28
 {"NETWORK/WV_SKIN.PNG", PROGS .. "/cmm/browser/wv_skin.png"},
29
 {"SETTINGS/AUTORUN.DAT", build_type .. "/settings/autorun.dat"},
30
 {"DEFAULT.SKN", build_type .. "/default.skn"},
31
 {"SETTINGS/ICON.INI", build_type .. "/settings/icon.ini"},
32
 {"ICONSTRP.PNG", "common/iconstrp.png"},
33
 {"INDEX.HTM", build_type .. "/index_htm"},
34
 {"KERPACK", "common/kerpack"},
35
 {"SETTINGS/KEYMAP.KEY", build_type .. "/settings/keymap.key"},
36
 {"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"},
37
 {"KUZKINA.MID", "common/kuzkina.mid"},
38
 {"LANG.INC", build_type .. "/lang.inc"},
39
 {"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"},
40
 {"SETTINGS/KOLIBRI.LBL", build_type .. "/settings/kolibri.lbl"},
41
 {"SETTINGS/PANEL.INI", build_type .. "/settings/panel.ini"},
42
 {"SETTINGS/DOCKY.INI", "common/settings/docky.ini"},
43
 {"NOTIFY3.PNG", "common/notify3.png"},
44
 {"SETTINGS/SETUP.DAT", build_type .. "/settings/setup.dat"},
45
 {"VMODE", "common/vmode"},
46
 {"3D/HOUSE.3DS", "common/3d/house.3ds"},
47
 {"DEMOS/AK47.LIF", "common/demos/ak47.lif"},
48
 {"DEMOS/LIFE2", "common/demos/life2"},
49
 {"DEMOS/RELAY.LIF", "common/demos/relay.lif"},
50
 {"DEMOS/RPENTO.LIF", "common/demos/rpento.lif"},
51
 {"File Managers/EOLITE.INI", "common/File Managers/eolite.ini"},
52
 {"File Managers/ICONS.INI", "common/File Managers/icons.ini"},
53
 {"File Managers/KFM.INI", "common/File Managers/kfm.ini"},
54
 {"GAMES/MEGAMAZE", build_type .. "/games/megamaze"},
55
 {"LIB/PIXLIB.OBJ", "common/lib/pixlib.obj"},
56
 {"LIB/ICONV.OBJ", "common/lib/iconv.obj"},
57
 {"LIB/NETCODE.OBJ", "common/lib/netcode.obj"},
58
 {"MEDIA/ImgF/ImgF", "common/media/ImgF/ImgF"},
59
 {"MEDIA/ImgF/cEdg.obj", "common/media/ImgF/cEdg.obj"},
60
 {"MEDIA/ImgF/dither.obj", "common/media/ImgF/dither.obj"},
61
 {"MEDIA/ImgF/invSol.obj", "common/media/ImgF/invSol.obj"},
62
 {"SETTINGS/NETWORK.INI", build_type .. "/settings/network.ini"},
63
 {"NETWORK/FTPD.INI", "common/network/ftpd.ini"},
64
 {"NETWORK/USERS.INI", "common/network/users.ini"},
65
}
66
-- For russian build, add russian-only files.
67
if build_type == "rus" then tup.append_table(img_files, {
68
 {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt"},
69
 {"SETTINGS/.shell", PROGS .. "/system/shell/bin/rus/.shell"},
70
 {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
71
 {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/rus/example.asm"},
72
 {"PIPETKA", build_type .. "/pipetka"},
73
 {"File Managers/KFAR.INI", build_type .. "/File Managers/kfar.ini"},
74
 {"GAMES/APPDATA.DAT", build_type .. "/games/appdata.dat"},
75
 {"GAMES/ATAKA", build_type .. "/games/ataka"},
76
 {"GAMES/BASEKURS.KLA", build_type .. "/games/basekurs.kla"},
77
 {"GAMES/PADENIE", build_type .. "/games/padenie"},
78
 {"GAMES/WHOWTBAM", build_type .. "/games/whowtbam"},
79
}) else tup.append_table(img_files, {
80
 {"File Managers/KFM_KEYS.TXT", PROGS .. "/fs/kfm/trunk/docs/english/kfm_keys.txt"},
81
 {"GAMES/SKIN.RAW", PROGS .. "/games/soko/trunk/SKIN.RAW"},
82
 {"GAMES/SOKO-4.LEV", PROGS .. "/games/soko/trunk/SOKO-4.LEV"},
83
 {"GAMES/SOKO-5.LEV", PROGS .. "/games/soko/trunk/SOKO-5.LEV"},
84
 {"GAMES/SOKO-6.LEV", PROGS .. "/games/soko/trunk/SOKO-6.LEV"},
85
 {"GAMES/SOKO-7.LEV", PROGS .. "/games/soko/trunk/SOKO-7.LEV"},
86
 {"GAMES/SOKO-8.LEV", PROGS .. "/games/soko/trunk/SOKO-8.LEV"},
87
 {"GAMES/SOKO-9.LEV", PROGS .. "/games/soko/trunk/SOKO-9.LEV"},
88
 {"SETTINGS/.shell", PROGS .. "/system/shell/bin/eng/.shell"},
89
 {"EXAMPLE.ASM", PROGS .. "/develop/examples/example/trunk/example.asm"},
90
 {"File Managers/KFAR.INI", "common/File Managers/kfar.ini"},
91
}) end
92
if build_type == "it" then tup.append_table(img_files, {
93
 {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey_it.ini"},
94
}) else tup.append_table(img_files, {
95
 {"SETTINGS/MYKEY.INI", PROGS .. "/system/MyKey/trunk/mykey.ini"},
96
}) end
97
 
98
--[[
99
Files to be included in kolibri.iso and distribution kit outside of kolibri.img.
5132 clevermous 100
 
5098 clevermous 101
The first subitem of every item is name relative to the root of ISO or distribution kit,
102
the second is name of local file.
5132 clevermous 103
 
5098 clevermous 104
If the first subitem ends in /, the last component of local file name is appended.
105
The last component of the second subitem may contain '*'; if so, it will be expanded
106
according to usual rules, but without matching directories.
5132 clevermous 107
 
108
Tup does not allow a direct dependency on a file that is generated in a directory
109
other than where Tupfile.lua is and its children. Most files are generated
110
in the directory with Tupfile.lua; for other files, the item should contain
111
a named subitem "group=path/" and the file should be put in .
5098 clevermous 112
--]]
113
extra_files = {
114
 {"/", build_type .. "/distr_data/autorun.inf"},
115
 {"/", build_type .. "/distr_data/KolibriOS_icon.ico"},
116
 {"/", build_type .. "/settings/kolibri.lbl"},
117
 {"Skins/", "../skins/authors.txt"},
118
 {"Docs/stack.txt", build_type .. "/docs/STACK.TXT"},
119
 {"HD_Load/9x2klbr/", "common/HD_load/9x2klbr/LDKLBR.VXD"},
120
 {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/AUTOEXEC.BAT"},
121
 {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/CONFIG.SYS"},
122
 {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/L_readme.txt"},
123
 {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/L_readme_Win.txt"},
124
 {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/vista_install.bat"},
125
 {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/vista_remove.bat"},
126
 {"HD_Load/", "common/HD_load/memdisk"},
127
 {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot.rtf"},
128
 {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot_866.txt"},
129
 {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/usb_boot_1251.txt"},
130
 {"games/pig/", "common/games/pig/*"},
131
 {"games/soko/soko", build_type .. "/games/soko"},
132
 {"games/soko/", "common/games/soko/*"},
133
 {"kolibrios/emul/dosbox/", "common/emul/DosBox/*"},
134
 {"kolibrios/emul/fceu/", "common/emul/fceu/*"},
135
 {"kolibrios/emul/", "common/emul/gameboy"},
136
 {"kolibrios/emul/", "common/emul/scummvm"},
137
 {"kolibrios/emul/", "common/emul/zsnes"},
138
 {"kolibrios/games/doom/", "common/games/doom/*"},
139
 {"kolibrios/games/fara/fara.gfx", "common/games/fara.gfx"},
5296 ZblCoder 140
 {"kolibrios/games/LaserTank/", "common/games/LaserTank/*"},
5098 clevermous 141
 {"kolibrios/games/jumpbump/", "common/games/jumpbump/*"},
142
 {"kolibrios/games/lrl/", "common/games/lrl/*"},
5255 mario79 143
 {"kolibrios/games/rstearth/barret_8bpp.png", PROGS .. "/games/rstearth/resources/barret_8bpp.png"},
144
 {"kolibrios/games/rstearth/base_8bpp.png", PROGS .. "/games/rstearth/resources/base_8bpp.png"},
145
 {"kolibrios/games/rstearth/death_8bpp.png", PROGS .. "/games/rstearth/resources/death_8bpp.png"},
5265 mario79 146
 {"kolibrios/games/rstearth/font_russo_1bpp.png", PROGS .. "/games/rstearth/resources/font_russo_1bpp.png"},
5255 mario79 147
 {"kolibrios/games/rstearth/ifrit_8bpp.png", PROGS .. "/games/rstearth/resources/ifrit_8bpp.png"},
148
 {"kolibrios/games/rstearth/miku_8bpp.png", PROGS .. "/games/rstearth/resources/miku_8bpp.png"},
149
 {"kolibrios/games/rstearth/red_brick_8bpp.png", PROGS .. "/games/rstearth/resources/red_brick_8bpp.png"},
150
 {"kolibrios/games/rstearth/skeleton_8bpp.png", PROGS .. "/games/rstearth/resources/skeleton_8bpp.png"},
151
 {"kolibrios/games/rstearth/white_brick_8bpp.png", PROGS .. "/games/rstearth/resources/white_brick_8bpp.png"},
152
 {"kolibrios/games/rstearth/flaunch.wav", PROGS .. "/games/rstearth/resources/flaunch.wav"},
5275 mario79 153
 {"kolibrios/games/rstearth/misc_menu.wav", PROGS .. "/games/rstearth/resources/misc_menu.wav"},
5255 mario79 154
 {"kolibrios/games/rstearth/walking_with_poseidon.wav", PROGS .. "/games/rstearth/resources/walking_with_poseidon.wav"},
5098 clevermous 155
 {"kolibrios/lib/avcodec-55.dll", "common/lib/avcodec-55.dll"},
156
 {"kolibrios/lib/avdevice-55.dll", "common/lib/avdevice-55.dll"},
157
 {"kolibrios/lib/avformat-55.dll", "common/lib/avformat-55.dll"},
158
 {"kolibrios/lib/avutil-52.dll", "common/lib/avutil-52.dll"},
159
 {"kolibrios/lib/freetype.dll", "common/lib/freetype.dll"},
5132 clevermous 160
 {"kolibrios/lib/libc.dll", "../contrib/sdk/bin/libc.dll", group = "../contrib/sdk/lib/"},
5098 clevermous 161
 {"kolibrios/lib/pixlib.dll", "common/lib/pixlib.dll"},
162
 {"kolibrios/lib/swresample-0.dll", "common/lib/swresample-0.dll"},
163
 {"kolibrios/lib/swscale-2.dll", "common/lib/swscale-2.dll"},
164
 {"kolibrios/lib/zlib.dll", "common/lib/zlib.dll"},
165
 {"kolibrios/media/fplay-full", "common/media/fplay-full"},
166
 {"kolibrios/media/zsea/zsea.ini", PROGS .. "/media/zsea/zSea.ini"},
167
 {"kolibrios/media/zsea/buttons/buttons.png", PROGS .. "/media/zsea/buttons.png"},
168
}
169
if build_type == "rus" then tup.append_table(extra_files, {
170
 {"Docs/cp866/config.txt", build_type .. "/docs/CONFIG.TXT"},
171
 {"Docs/cp866/gnu.txt", build_type .. "/docs/GNU.TXT"},
172
 {"Docs/cp866/history.txt", build_type .. "/docs/HISTORY.TXT"},
173
 {"Docs/cp866/hot_keys.txt", build_type .. "/docs/HOT_KEYS.TXT"},
174
 {"Docs/cp866/install.txt", build_type .. "/docs/INSTALL.TXT"},
175
 {"Docs/cp866/readme.txt", build_type .. "/docs/README.TXT"},
176
 {"Docs/cp866/sysfuncr.txt", PROGS .. "/system/docpack/trunk/SYSFUNCR.TXT"},
177
 {"Docs/cp1251/config.txt", build_type .. "/docs/CONFIG.WIN.TXT", cp1251_from = build_type .. "/docs/CONFIG.TXT"},
178
 {"Docs/cp1251/gnu.txt", build_type .. "/docs/GNU.WIN.TXT", cp1251_from = build_type .. "/docs/GNU.TXT"},
179
 {"Docs/cp1251/history.txt", build_type .. "/docs/HISTORY.WIN.TXT", cp1251_from = build_type .. "/docs/HISTORY.TXT"},
180
 {"Docs/cp1251/hot_keys.txt", build_type .. "/docs/HOT_KEYS.WIN.TXT", cp1251_from = build_type .. "/docs/HOT_KEYS.TXT"},
181
 {"Docs/cp1251/install.txt", build_type .. "/docs/INSTALL.WIN.TXT", cp1251_from = build_type .. "/docs/INSTALL.TXT"},
182
 {"Docs/cp1251/readme.txt", build_type .. "/docs/README.WIN.TXT", cp1251_from = build_type .. "/docs/README.TXT"},
183
 {"Docs/cp1251/sysfuncr.txt", build_type .. "/docs/SYSFUNCR.WIN.TXT", cp1251_from = PROGS .. "/system/docpack/trunk/SYSFUNCR.TXT"},
184
 {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme_dos.txt"},
185
 {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme_win.txt"},
186
 {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/install.txt"},
187
 {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/readme.txt"},
188
 {"kolibrios/media/zsea/zsea_keys.txt", PROGS .. "/media/zsea/Docs/zSea_keys_rus.txt"},
5334 Anton_K 189
 {"kolibrios/games/Dungeons/Resources/Textures/Environment/", PROGS .. "/games/Dungeons/Resources/Textures/Environment/*"},
190
 {"kolibrios/games/Dungeons/Resources/Textures/Objects/", PROGS .. "/games/Dungeons/Resources/Textures/Objects/*"},
191
 {"kolibrios/games/Dungeons/Resources/Textures/HUD/", PROGS .. "/games/Dungeons/Resources/Textures/HUD/*"},
192
 {"kolibrios/games/Dungeons/Resources/Textures/", PROGS .. "/games/Dungeons/Resources/Textures/Licenses.txt"},
193
 {"kolibrios/games/Dungeons/", PROGS .. "/games/Dungeons/readme_ru.txt"},
5098 clevermous 194
}) else tup.append_table(extra_files, {
195
 {"Docs/config.txt", build_type .. "/docs/CONFIG.TXT"},
196
 {"Docs/copying.txt", build_type .. "/docs/COPYING.TXT"},
197
 {"Docs/hot_keys.txt", build_type .. "/docs/HOT_KEYS.TXT"},
198
 {"Docs/install.txt", build_type .. "/docs/INSTALL.TXT"},
199
 {"Docs/readme.txt", build_type .. "/docs/README.TXT"},
200
 {"Docs/sysfuncs.txt", PROGS .. "/system/docpack/trunk/SYSFUNCS.TXT"},
201
 {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/readme.txt"},
202
 {"HD_Load/mtldr/install.txt", PROGS .. "/hd_load/mtldr/install_eng.txt"},
203
 {"HD_Load/USB_Boot/readme.txt", PROGS .. "/hd_load/usb_boot/readme_eng.txt"},
204
 {"kolibrios/media/zsea/zsea_keys.txt", PROGS .. "/media/zsea/Docs/zSea_keys_eng.txt"},
205
}) end
206
--[[
207
Files to be included in distribution kit outside of kolibri.img, but not kolibri.iso.
208
Same syntax as extra_files.
209
]]--
210
if build_type == "rus" then
211
distr_extra_files = {
212
 {"/readme_dos.txt", build_type .. "/distr_data/readme_dos_distr.txt"},
213
 {"/readme.txt", build_type .. "/distr_data/readme_distr.txt", cp1251_from = build_type .. "/distr_data/readme_dos_distr.txt"},
214
}
215
else
216
distr_extra_files = {
217
 {"/readme.txt", build_type .. "/distr_data/readme_distr.txt"},
218
}
219
end
220
--[[
221
Files to be included in kolibri.iso outside of kolibri.img, but not distribution kit.
222
Same syntax as extra_files.
223
]]--
224
if build_type == "rus" then
225
iso_extra_files = {
226
 {"/readme_dos.txt", build_type .. "/distr_data/readme_dos.txt"},
227
 {"/readme.txt", build_type .. "/distr_data/readme.txt", cp1251_from = build_type .. "/distr_data/readme_dos.txt"},
228
}
229
else
230
iso_extra_files = {
231
 {"/readme.txt", build_type .. "/distr_data/readme.txt"},
232
}
233
end
234
 
235
-- Programs that require FASM to compile.
236
if tup.getconfig('NO_FASM') ~= 'full' then
237
tup.append_table(img_files, {
238
 {"KERNEL.MNT", "../kernel/trunk/kernel.mnt"},
239
 {"@MENU", PROGS .. "/system/menu/trunk/menu"},
240
 {"@PANEL", PROGS .. "/system/panel/trunk/@PANEL"},
241
 {"@DOCKY", PROGS .. "/system/docky/trunk/docky"},
242
 {"@NOTIFY", PROGS .. "/system/notify3/notify"},
243
 {"@SS", PROGS .. "/system/ss/trunk/@ss"},
244
 {"REFRSCRN", PROGS .. "/system/refrscrn/refrscrn"},
245
 {"ASCIIVJU", PROGS .. "/develop/asciivju/trunk/asciivju"},
246
 {"CALC", PROGS .. "/other/calc/trunk/calc"},
247
 {"CALENDAR", PROGS .. "/system/calendar/trunk/calendar"},
248
 {"COLRDIAL", PROGS .. "/system/colrdial/color_dialog"},
249
 {"LOADDRV", PROGS .. "/system/loaddrv/loaddrv"},
250
 {"CPU", PROGS .. "/system/cpu/trunk/cpu"},
251
 {"CPUID", PROGS .. "/system/cpuid/trunk/CPUID"},
252
 {"DESKTOP", PROGS .. "/system/desktop/trunk/desktop"},
253
 {"DISPTEST", PROGS .. "/system/disptest/trunk/disptest"},
254
 {"DOCPACK", PROGS .. "/system/docpack/trunk/docpack"},
255
 {"END", PROGS .. "/system/end/light/end"},
256
 {"FSPEED", PROGS .. "/fs/fspeed/fspeed"},
257
 {"GMON", PROGS .. "/system/gmon/gmon"},
258
 {"HDD_INFO", PROGS .. "/system/hdd_info/trunk/hdd_info"},
259
 {"@ICON", PROGS .. "/system/icon_new/@icon"},
260
 {"CROPFLAT", PROGS .. "/system/cropflat/cropflat"},
261
 {"KBD", PROGS .. "/system/kbd/trunk/kbd"},
262
 {"KPACK", PROGS .. "/other/kpack/trunk/kpack"},
263
 {"LAUNCHER", PROGS .. "/system/launcher/trunk/launcher"},
264
 {"MAGNIFY", PROGS .. "/demos/magnify/trunk/magnify"},
265
 {"MGB", PROGS .. "/system/mgb/trunk/mgb"},
266
 {"MOUSEMUL", PROGS .. "/system/mousemul/trunk/mousemul"},
267
 {"MADMOUSE", PROGS .. "/other/madmouse/madmouse"},
268
 {"MYKEY", PROGS .. "/system/MyKey/trunk/MyKey"},
269
 {"PCIDEV", PROGS .. "/system/pcidev/trunk/PCIDEV"},
270
 {"RDSAVE", PROGS .. "/system/rdsave/trunk/rdsave"},
271
 {"RTFREAD", PROGS .. "/other/rtfread/trunk/rtfread"},
272
 {"RUN", PROGS .. "/system/run/trunk/run"},
273
 {"SEARCHAP", PROGS .. "/system/searchap/searchap"},
274
 {"SCRSHOOT", PROGS .. "/media/scrshoot/scrshoot"},
275
 {"SETUP", PROGS .. "/system/setup/trunk/setup"},
276
 {"TEST", PROGS .. "/system/test/trunk/test"},
277
 {"TINYPAD", PROGS .. "/develop/tinypad/trunk/tinypad"},
278
 {"ZKEY", PROGS .. "/system/zkey/trunk/ZKEY"},
279
 {"TERMINAL", PROGS .. "/system/terminal/terminal"},
280
 {"3D/3DSHEART", PROGS .. "/demos/3dsheart/trunk/3dsheart"},
281
 {"3D/3DWAV", PROGS .. "/demos/3dwav/trunk/3dwav"},
282
 {"3D/CROWNSCR", PROGS .. "/demos/crownscr/trunk/crownscr"},
283
 {"3D/FREE3D04", PROGS .. "/demos/free3d04/trunk/free3d04"},
284
 {"3D/VIEW3DS", PROGS .. "/demos/3DS/VIEW3DS"},
285
 {"DEMOS/BCDCLK", PROGS .. "/demos/bcdclk/trunk/bcdclk"},
286
 {"DEMOS/CIRCLE", PROGS .. "/develop/examples/circle/trunk/circle"},
287
 {"DEMOS/COLORREF", PROGS .. "/demos/colorref/trunk/colorref"},
288
 {"DEMOS/CSLIDE", PROGS .. "/demos/cslide/trunk/cslide"},
289
 {"DEMOS/EYES", PROGS .. "/demos/eyes/trunk/eyes"},
290
 {"DEMOS/FIREWORK", PROGS .. "/demos/firework/trunk/firework"},
291
 {"DEMOS/MOVBACK", PROGS .. "/demos/movback/trunk/movback"},
292
 {"DEMOS/PLASMA", PROGS .. "/demos/plasma/trunk/plasma"},
293
 {"DEMOS/TINYFRAC", PROGS .. "/demos/tinyfrac/trunk/tinyfrac"},
294
 {"DEMOS/TRANTEST", PROGS .. "/demos/trantest/trunk/trantest"},
295
 {"DEMOS/TUBE", PROGS .. "/demos/tube/trunk/tube"},
296
 {"DEMOS/UNVWATER", PROGS .. "/demos/unvwater/trunk/unvwater"},
297
 {"DEMOS/USE_MB", PROGS .. "/demos/use_mb/use_mb"},
298
 {"DEMOS/WEB", PROGS .. "/demos/web/trunk/web"},
299
 {"DEVELOP/BOARD", PROGS .. "/system/board/trunk/board"},
300
 {"DEVELOP/cObj", PROGS .. "/develop/cObj/trunk/cObj"},
301
 {"DEVELOP/FASM", PROGS .. "/develop/fasm/trunk/fasm"},
302
 {"DEVELOP/H2D2B", PROGS .. "/develop/h2d2b/trunk/h2d2b"},
303
 {"DEVELOP/HEED", PROGS .. "/develop/heed/trunk/heed"},
304
 {"DEVELOP/KEYASCII", PROGS .. "/develop/keyascii/trunk/keyascii"},
305
 {"DEVELOP/MTDBG", PROGS .. "/develop/mtdbg/mtdbg"},
306
 {"DEVELOP/SCANCODE", PROGS .. "/develop/scancode/trunk/scancode"},
307
 {"DEVELOP/T_EDIT", PROGS .. "/other/t_edit/t_edit"},
308
 {"DEVELOP/test_gets", PROGS .. "/develop/libraries/console/examples/test_gets"},
309
 {"DEVELOP/THREAD", PROGS .. "/develop/examples/thread/trunk/thread"},
310
 {"DEVELOP/INFO/ASM.SYN", PROGS .. "/other/t_edit/info/asm.syn"},
311
 {"DEVELOP/INFO/CPP_KOL_CLA.SYN", PROGS .. "/other/t_edit/info/cpp_kol_cla.syn"},
312
 {"DEVELOP/INFO/CPP_KOL_DAR.SYN", PROGS .. "/other/t_edit/info/cpp_kol_dar.syn"},
313
 {"DEVELOP/INFO/CPP_KOL_DEF.SYN", PROGS .. "/other/t_edit/info/cpp_kol_def.syn"},
314
 {"DEVELOP/INFO/DEFAULT.SYN", PROGS .. "/other/t_edit/info/default.syn"},
315
 {"DEVELOP/INFO/HTML.SYN", PROGS .. "/other/t_edit/info/html.syn"},
316
 {"DEVELOP/INFO/INI_FILES.SYN", PROGS .. "/other/t_edit/info/ini_files.syn"},
317
 {"DEVELOP/INFO/WIN_CONST.SYN", PROGS .. "/other/t_edit/info/win_const.syn"},
318
 {"File Managers/KFAR", PROGS .. "/fs/kfar/trunk/kfar"},
319
 {"File Managers/KFM", PROGS .. "/fs/kfm/trunk/kfm"},
320
 {"File Managers/OPENDIAL", PROGS .. "/fs/opendial/opendial"},
321
 {"GAMES/15", PROGS .. "/games/15/trunk/15"},
322
 {"GAMES/ARCANII", PROGS .. "/games/arcanii/trunk/arcanii"},
323
 {"GAMES/FREECELL", PROGS .. "/games/freecell/freecell"},
324
 {"GAMES/GOMOKU", PROGS .. "/games/gomoku/trunk/gomoku"},
325
 {"GAMES/INVADERS", PROGS .. "/games/invaders/invaders"},
326
 {"GAMES/KLAVISHA", PROGS .. "/games/klavisha/trunk/klavisha"},
327
 {"GAMES/LINES", PROGS .. "/games/lines/lines"},
328
 {"GAMES/MBLOCKS", PROGS .. "/games/mblocks/trunk/mblocks"},
329
 {"GAMES/MSQUARE", PROGS .. "/games/MSquare/trunk/MSquare"},
330
 {"GAMES/PHENIX", PROGS .. "/games/phenix/trunk/phenix"},
331
 {"GAMES/PIPES", PROGS .. "/games/pipes/pipes"},
332
 {"GAMES/PONG", PROGS .. "/games/pong/trunk/pong"},
333
 {"GAMES/PONG3", PROGS .. "/games/pong3/trunk/pong3"},
334
 {"GAMES/RSQUARE", PROGS .. "/games/rsquare/trunk/rsquare"},
335
 {"GAMES/SNAKE", PROGS .. "/games/snake/trunk/snake"},
336
 {"GAMES/SQ_GAME", PROGS .. "/games/sq_game/trunk/SQ_GAME"},
337
 {"GAMES/SUDOKU", PROGS .. "/games/sudoku/trunk/sudoku"},
338
 {"GAMES/SW", PROGS .. "/games/sw/trunk/sw"},
339
 {"GAMES/TANKS", PROGS .. "/games/tanks/trunk/tanks"},
340
 {"GAMES/TETRIS", PROGS .. "/games/tetris/trunk/tetris"},
341
 {"LIB/ARCHIVER.OBJ", PROGS .. "/fs/kfar/trunk/kfar_arc/kfar_arc.obj"},
342
 {"LIB/BOX_LIB.OBJ", PROGS .. "/develop/libraries/box_lib/trunk/box_lib.obj"},
343
 {"LIB/BUF2D.OBJ", PROGS .. "/develop/libraries/buf2d/trunk/buf2d.obj"},
344
 {"LIB/CONSOLE.OBJ", PROGS .. "/develop/libraries/console/console.obj"},
345
 {"LIB/LIBGFX.OBJ", PROGS .. "/develop/libraries/libs-dev/libgfx/libgfx.obj"},
346
 {"LIB/LIBIMG.OBJ", PROGS .. "/develop/libraries/libs-dev/libimg/libimg.obj"},
347
 {"LIB/LIBINI.OBJ", PROGS .. "/develop/libraries/libs-dev/libini/libini.obj"},
348
 {"LIB/LIBIO.OBJ", PROGS .. "/develop/libraries/libs-dev/libio/libio.obj"},
349
 {"LIB/MSGBOX.OBJ", PROGS .. "/develop/libraries/msgbox/msgbox.obj"},
350
 {"LIB/NETWORK.OBJ", PROGS .. "/develop/libraries/network/network.obj"},
351
 {"LIB/SORT.OBJ", PROGS .. "/develop/libraries/sorter/sort.obj"},
352
 {"LIB/HTTP.OBJ", PROGS .. "/develop/libraries/http/http.obj"},
353
 {"LIB/PROC_LIB.OBJ", PROGS .. "/develop/libraries/proc_lib/trunk/proc_lib.obj"},
354
 {"LIB/CNV_PNG.OBJ", PROGS .. "/media/zsea/plugins/png/cnv_png.obj"},
355
 {"MEDIA/ANIMAGE", PROGS .. "/media/animage/trunk/animage"},
356
 {"MEDIA/KIV", PROGS .. "/media/kiv/trunk/kiv"},
357
 {"MEDIA/LISTPLAY", PROGS .. "/media/listplay/trunk/listplay"},
358
 {"MEDIA/MIDAMP", PROGS .. "/media/midamp/trunk/midamp"},
359
 {"MEDIA/PALITRA", PROGS .. "/media/palitra/trunk/palitra"},
360
 {"MEDIA/STARTMUS", PROGS .. "/media/startmus/trunk/STARTMUS"},
361
 {"NETWORK/PING", PROGS .. "/network/icmp/ping"},
362
 {"NETWORK/NETCFG", PROGS .. "/network/netcfg/netcfg"},
363
 {"NETWORK/NETSTAT", PROGS .. "/network/netstat/netstat"},
364
 {"NETWORK/NSLOOKUP", PROGS .. "/network/nslookup/nslookup"},
365
 {"NETWORK/PASTA", PROGS .. "/network/pasta/pasta"},
366
 {"NETWORK/SYNERGYC", PROGS .. "/network/synergyc/synergyc"},
367
 {"NETWORK/TCPSERV", PROGS .. "/network/tcpserv/tcpserv"},
368
 {"NETWORK/TELNET", PROGS .. "/network/telnet/telnet"},
369
 {"NETWORK/ZEROCONF", PROGS .. "/network/zeroconf/zeroconf"},
370
 {"NETWORK/FTPC", PROGS .. "/network/ftpc/ftpc"},
371
 {"NETWORK/FTPD", PROGS .. "/network/ftpd/ftpd"},
372
 {"NETWORK/TFTPC", PROGS .. "/network/tftpc/tftpc"},
373
 {"NETWORK/IRCC", PROGS .. "/network/ircc/ircc"},
374
 {"NETWORK/DOWNLOADER", PROGS .. "/network/downloader/downloader"},
375
 {"DRIVERS/VIDINTEL.SYS", "../drivers/video/vidintel.sys"},
376
 {"DRIVERS/3C59X.SYS", "../drivers/ethernet/3c59x.sys"},
377
 {"DRIVERS/DEC21X4X.SYS", "../drivers/ethernet/dec21x4x.sys"},
378
 {"DRIVERS/FORCEDETH.SYS", "../drivers/ethernet/forcedeth.sys"},
379
 {"DRIVERS/I8254X.SYS", "../drivers/ethernet/i8254x.sys"},
380
 {"DRIVERS/I8255X.SYS", "../drivers/ethernet/i8255x.sys"},
381
 {"DRIVERS/MTD80X.SYS", "../drivers/ethernet/mtd80x.sys"},
382
 {"DRIVERS/PCNET32.SYS", "../drivers/ethernet/pcnet32.sys"},
383
 {"DRIVERS/R6040.SYS", "../drivers/ethernet/R6040.sys"},
384
 {"DRIVERS/RHINE.SYS", "../drivers/ethernet/rhine.sys"},
385
 {"DRIVERS/RTL8029.SYS", "../drivers/ethernet/RTL8029.sys"},
386
 {"DRIVERS/RTL8139.SYS", "../drivers/ethernet/RTL8139.sys"},
387
 {"DRIVERS/RTL8169.SYS", "../drivers/ethernet/RTL8169.sys"},
388
 {"DRIVERS/SIS900.SYS", "../drivers/ethernet/sis900.sys"},
389
 {"DRIVERS/UHCI.SYS", "../drivers/usb/uhci.sys"},
390
 {"DRIVERS/OHCI.SYS", "../drivers/usb/ohci.sys"},
391
 {"DRIVERS/EHCI.SYS", "../drivers/usb/ehci.sys"},
392
 {"DRIVERS/USBHID.SYS", "../drivers/usb/usbhid/usbhid.sys"},
393
 {"DRIVERS/USBSTOR.SYS", "../drivers/usb/usbstor.sys"},
394
 {"DRIVERS/RDC.SYS", "../drivers/video/rdc.sys"},
395
 {"DRIVERS/COMMOUSE.SYS", "../drivers/mouse/commouse.sys"},
396
 {"DRIVERS/PS2MOUSE.SYS", "../drivers/mouse/ps2mouse4d/trunk/ps2mouse.sys"},
397
 {"DRIVERS/TMPDISK.SYS", "../drivers/disk/tmpdisk.sys"},
398
 {"DRIVERS/intel_hda.sys", "../drivers/audio/intel_hda/intel_hda.sys"},
399
 {"DRIVERS/SB16.SYS", "../drivers/audio/sb16/sb16.sys"},
400
 {"DRIVERS/SOUND.SYS", "../drivers/audio/sound.sys"},
401
 {"DRIVERS/INFINITY.SYS", "../drivers/audio/infinity/infinity.sys"},
402
 {"DRIVERS/INTELAC97.SYS", "../drivers/audio/intelac97.sys"},
403
 {"DRIVERS/EMU10K1X.SYS", "../drivers/audio/emu10k1x.sys"},
404
 {"DRIVERS/FM801.SYS", "../drivers/audio/fm801.sys"},
405
 {"DRIVERS/VT823X.SYS", "../drivers/audio/vt823x.sys"},
406
 {"DRIVERS/SIS.SYS", "../drivers/audio/sis.sys"},
407
})
408
tup.append_table(extra_files, {
409
 {"HD_Load/9x2klbr/", PROGS .. "/hd_load/9x2klbr/9x2klbr.exe"},
410
 {"HD_Load/MeOSLoad/", PROGS .. "/hd_load/meosload/MeOSload.com"},
411
 {"HD_Load/mtldr/", PROGS .. "/hd_load/mtldr/mtldr"},
412
 {"HD_Load/", PROGS .. "/hd_load/mtldr_install/mtldr_install.exe"},
413
 {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/BOOT_F32.BIN"},
414
 {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/MTLD_F32"},
415
 {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/inst.exe"},
416
 {"HD_Load/USB_Boot/", PROGS .. "/hd_load/usb_boot/setmbr.exe"},
417
 {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/MeOSload.com"},
418
 {"HD_Load/USB_boot_old/", PROGS .. "/hd_load/usb_boot_old/enable.exe"},
5335 yogev_ezra 419
 {"kolibrios/games/codemaster/binary_master", PROGS .. "/games/codemaster/binary_master"},
420
 {"kolibrios/games/codemaster/hang_programmer", PROGS .. "/games/codemaster/hang_programmer"},
421
 {"kolibrios/games/codemaster/kolibri_puzzle", PROGS .. "/games/codemaster/kolibri_puzzle"},
5254 mario79 422
 {"kolibrios/games/rstearth/rstearth", PROGS .. "/games/rstearth/rstearth"},
5098 clevermous 423
 {"kolibrios/media/zsea/zsea", PROGS .. "/media/zsea/zSea"},
424
 {"kolibrios/media/zsea/plugins/cnv_bmp.obj", PROGS .. "/media/zsea/plugins/bmp/cnv_bmp.obj"},
425
 {"kolibrios/media/zsea/plugins/cnv_gif.obj", PROGS .. "/media/zsea/plugins/gif/cnv_gif.obj"},
426
 {"kolibrios/media/zsea/plugins/cnv_jpeg.obj", PROGS .. "/media/zsea/plugins/jpeg/cnv_jpeg.obj"},
427
 {"kolibrios/media/zsea/plugins/convert.obj", PROGS .. "/media/zsea/plugins/convert/convert.obj"},
428
 {"kolibrios/media/zsea/plugins/rotate.obj", PROGS .. "/media/zsea/plugins/rotate/rotate.obj"},
429
 {"kolibrios/media/zsea/plugins/scaling.obj", PROGS .. "/media/zsea/plugins/scaling/scaling.obj"},
430
})
431
-- For russian build, add russian-only programs.
432
if build_type == "rus" then tup.append_table(img_files, {
433
 {"PERIOD", PROGS .. "/other/period/trunk/period"},
434
 {"DEVELOP/TESTCON2", PROGS .. "/develop/libraries/console/examples/testcon2_rus"},
435
}) else tup.append_table(img_files, {
436
 {"DEVELOP/TESTCON2", PROGS .. "/develop/libraries/console/examples/testcon2_eng"},
437
 {"GAMES/SOKO", PROGS .. "/games/soko/trunk/SOKO"},
438
}) end
439
 
5334 Anton_K 440
if build_type == "rus" then tup.append_table(extra_files, {
441
 {"kolibrios/games/Dungeons/Dungeons", PROGS .. "/games/Dungeons/Dungeons"},
442
}) end
443
 
5098 clevermous 444
end -- tup.getconfig('NO_FASM') ~= 'full'
445
 
446
-- Programs that require NASM to compile.
447
if tup.getconfig('NO_NASM') ~= 'full' then
448
tup.append_table(img_files, {
449
 {"DEMOS/ACLOCK", PROGS .. "/demos/aclock/trunk/aclock"},
450
 {"DEMOS/TIMER", PROGS .. "/other/Timer/timer"},
451
 {"GAMES/C4", PROGS .. "/games/c4/trunk/c4"},
452
 {"TINFO", PROGS .. "/system/tinfo/tinfo"},
453
 {"DEVELOP/MSTATE", PROGS .. "/develop/mstate/mstate"},
454
})
455
end -- tup.getconfig('NO_NASM') ~= 'full'
456
 
457
-- Programs that require C-- to compile.
458
if tup.getconfig('NO_CMM') ~= 'full' then
459
tup.append_table(img_files, {
460
 {"File Managers/EOLITE", PROGS .. "/cmm/eolite/Eolite.com"},
461
 {"GAMES/CLICKS", PROGS .. "/games/clicks/trunk/clicks.com"},
462
 {"GAMES/FindNumbers", PROGS .. "/games/FindNumbers/trunk/FindNumbers"},
463
 {"GAMES/flood-it", PROGS .. "/games/flood-it/trunk/flood-it.com"},
464
 {"GAMES/MINE", PROGS .. "/games/mine/trunk/mine"},
465
 {"NETWORK/WebView", PROGS .. "/cmm/browser/WebView.com"},
466
 {"TMPDISK", PROGS .. "/cmm/tmpdisk/tmpdisk.com"},
467
})
468
end -- tup.getconfig('NO_CMM') ~= 'full'
469
 
470
-- Programs that require MSVC to compile.
471
if tup.getconfig('NO_MSVC') ~= 'full' then
472
tup.append_table(img_files, {
473
 {"GRAPH", PROGS .. "/other/graph/graph"},
474
 {"TABLE", PROGS .. "/other/table/table"},
475
 {"MEDIA/AC97SND", PROGS .. "/media/ac97snd/ac97snd.bin"},
476
 {"GAMES/KOSILKA", PROGS .. "/games/kosilka/kosilka"},
5113 clevermous 477
 {"GAMES/RFORCES", PROGS .. "/games/rforces/trunk/rforces"},
5115 clevermous 478
 {"GAMES/XONIX", PROGS .. "/games/xonix/trunk/xonix"},
5098 clevermous 479
})
5110 clevermous 480
tup.append_table(extra_files, {
5109 clevermous 481
 {"kolibrios/games/fara/fara", PROGS .. "/games/fara/trunk/fara"},
5276 ZblCoder 482
 {"kolibrios/games/LaserTank/LaserTank", PROGS .. "/games/LaserTank/trunk/LaserTank"},
5109 clevermous 483
})
5098 clevermous 484
end -- tup.getconfig('NO_MSVC') ~= 'full'
485
 
486
-- Programs that require GCC to compile.
487
if tup.getconfig('NO_GCC') ~= 'full' then
488
tup.append_table(img_files, {
5109 clevermous 489
 {"3D/CUBELINE", PROGS .. "/demos/cubeline/trunk/cubeline"},
490
 {"3D/GEARS", PROGS .. "/demos/gears/trunk/gears"},
5123 clevermous 491
 {"GAMES/CHECKERS", PROGS .. "/games/checkers/trunk/checkers"},
5111 clevermous 492
 {"GAMES/REVERSI", PROGS .. "/games/reversi/trunk/reversi"},
5098 clevermous 493
 {"SHELL", PROGS .. "/system/shell/shell"},
494
})
495
tup.append_table(extra_files, {
496
 {"kolibrios/emul/e80/e80", PROGS .. "/emulator/e80/trunk/e80"},
5228 alpine 497
 {"kolibrios/games/heliothryx/", PROGS .. "/games/heliothryx/heliothryx"},
5233 raandoom 498
 {"kolibrios/games/2048/", PROGS .. "/games/2048/2048"},
5236 alpine 499
 {"kolibrios/games/marblematch3/", PROGS .. "/games/marblematch3/marblematch3"},
5131 clevermous 500
 {"kolibrios/games/quake/", "common/games/quake/*"}, -- not really gcc, but no sense without sdlquake
501
 {"kolibrios/games/quake/", "../contrib/other/sdlquake-1.0.9/sdlquake"},
5098 clevermous 502
})
5327 igevorse 503
-- For russian build, add russian-only programs.
5329 igevorse 504
if build_type == "rus" then tup.append_table(extra_files, {
5327 igevorse 505
 {"kolibrios/games/21days/", PROGS .. "/games/21days/21days"},
5328 igevorse 506
}) end
5098 clevermous 507
end -- tup.getconfig('NO_GCC') ~= 'full'
508
 
509
-- Skins.
510
tup.include("../skins/skinlist.lua")
511
 
512
--[================================[ CODE ]================================]--
513
-- expand extra_files and similar
514
function expand_extra_files(files)
515
  local result = {}
516
  for i,v in ipairs(files) do
517
    if string.match(v[2], "%*")
518
    then
519
      local g = tup.glob(v[2])
520
      for j,x in ipairs(g) do
5132 clevermous 521
        table.insert(result, {v[1], x, group=v.group})
5098 clevermous 522
      end
523
    else
524
      if v.cp1251_from then
525
        tup.definerule{inputs = {v.cp1251_from}, command = 'iconv -f cp866 -t cp1251 "%f" > "%o"', outputs = {v[2]}}
526
      end
5132 clevermous 527
      table.insert(result, {v[1], v[2], group=v.group})
5098 clevermous 528
    end
529
  end
530
  return result
531
end
532
 
533
-- append skins to extra_files
534
for i,v in ipairs(skinlist) do
535
  table.insert(extra_files, {"Skins/", "../skins/" .. v})
536
end
537
 
538
-- prepare distr_extra_files and iso_extra_files: expand and append common part
539
extra_files = expand_extra_files(extra_files)
540
distr_extra_files = expand_extra_files(distr_extra_files)
541
iso_extra_files = expand_extra_files(iso_extra_files)
542
tup.append_table(distr_extra_files, extra_files)
543
tup.append_table(iso_extra_files, extra_files)
544
 
545
-- generate list of directories to be created inside kolibri.img
546
img_dirs = {}
547
input_deps = {}
548
for i,v in ipairs(img_files) do
549
  img_file = v[1]
550
  local_file = v[2]
551
 
552
  slash_pos = 0
553
  while true do
554
    slash_pos = string.find(img_file, '/', slash_pos + 1)
555
    if not slash_pos then break end
556
    table.insert(img_dirs, string.sub(img_file, 1, slash_pos - 1))
557
  end
558
 
559
  -- tup does not want to see hidden files as dependencies
560
  if not string.match(local_file, "/%.") then
5132 clevermous 561
    table.insert(input_deps, v.group or local_file)
5098 clevermous 562
  end
563
end
564
 
565
-- create empty 1.44M file
5118 clevermous 566
make_img_command = '^ MKIMG kolibri.img^ ' -- for tup: don't write full command to logs
567
make_img_command = make_img_command .. "dd if=/dev/zero of=kolibri.img count=2880 bs=512 2>&1"
5098 clevermous 568
-- format it as a standard 1.44M floppy
569
make_img_command = make_img_command .. " && mformat -f 1440 -i kolibri.img ::"
570
-- copy bootloader
571
if tup.getconfig("NO_FASM") ~= "full" then
572
bootloader = "../kernel/trunk/bootloader/boot_fat12.bin"
573
make_img_command = make_img_command .. " && dd if=" .. bootloader .. " of=kolibri.img count=1 bs=512 conv=notrunc 2>&1"
574
table.insert(input_deps, bootloader)
575
end
576
-- make folders
577
table.sort(img_dirs)
578
for i,v in ipairs(img_dirs) do
579
  if v ~= img_dirs[i-1] then
580
    make_img_command = make_img_command .. ' && mmd -i kolibri.img "::' .. v .. '"'
581
  end
582
end
583
-- copy files
584
for i,v in ipairs(img_files) do
585
  local_file = v[2]
586
  if v[1] == "KERNEL.MNT" and tup.getconfig("INSERT_REVISION_ID") ~= ""
587
  then
588
    -- for kernel.mnt, insert autobuild revision identifier
589
    -- from .revision to .kernel.mnt
590
    -- note that .revision and .kernel.mnt must begin with .
591
    -- to prevent tup from tracking them
592
    if build_type == "rus"
593
    then str='$(LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(cat .revision)]"|iconv -f utf8 -t cp866)'
594
    else str='$(date -u +"[auto-build %d %b %Y %R, r$(cat .revision)]")'
595
    end
596
    str = string.gsub(str, "%$", "\\$") -- escape $ as \$
597
    str = string.gsub(str, "%%", "%%%%") -- escape % as %%
598
    make_img_command = make_img_command .. " && cp " .. local_file .. " .kernel.mnt"
599
    make_img_command = make_img_command .. " && str=" .. str
600
    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'
601
    local_file = ".kernel.mnt"
602
  end
603
  make_img_command = make_img_command .. ' && mcopy -moi kolibri.img "' .. local_file .. '" "::' .. v[1] .. '"'
604
end
605
 
606
-- generate tup rule for kolibri.img
607
tup.definerule{inputs = input_deps, command = make_img_command, outputs = {"kolibri.img"}}
608
 
609
-- generate command and dependencies for mkisofs
610
input_deps = {"kolibri.img"}
611
iso_files_list = ""
612
for i,v in ipairs(iso_extra_files) do
613
  iso_files_list = iso_files_list .. ' "' .. v[1] .. '=' .. v[2] .. '"'
5132 clevermous 614
  table.insert(input_deps, v.group or v[2])
5098 clevermous 615
end
616
 
617
-- generate tup rule for kolibri.iso
618
if tup.getconfig("INSERT_REVISION_ID") ~= ""
619
then volume_id = "KolibriOS r`cat .revision`"
620
else volume_id = "KolibriOS"
621
end
622
tup.definerule{inputs = input_deps, command =
5118 clevermous 623
  '^ MKISOFS kolibri.iso^ ' .. -- for tup: don't write full command to logs
5098 clevermous 624
  'mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points ' ..
625
  '-A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "' .. volume_id .. '" -sysid "KOLIBRI" ' ..
626
  '-iso-level 3 -o kolibri.iso kolibri.img' .. iso_files_list .. ' 2>&1',
627
  outputs = {"kolibri.iso"}}
628
 
629
-- generate command and dependencies for distribution kit
5104 clevermous 630
cp = 'cp "%f" "%o"'
5102 clevermous 631
tup.definerule{inputs = {"kolibri.img"}, command = cp, outputs = {"distribution_kit/kolibri.img"}}
5098 clevermous 632
for i,v in ipairs(distr_extra_files) do
5132 clevermous 633
  cmd = cp:gsub("%%f", v[2]) -- input can be a group, we can't rely on tup's expansion of %f in this case
5098 clevermous 634
  if string.sub(v[1], -1) == "/"
5132 clevermous 635
  then tup.definerule{inputs = {v.group or v[2]}, command = cmd, outputs = {"distribution_kit/" .. v[1] .. tup.file(v[2])}}
636
  else tup.definerule{inputs = {v.group or v[2]}, command = cmd, outputs = {"distribution_kit/" .. v[1]}}
5098 clevermous 637
  end
638
end