Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
2817 IgorA 1
# General rule for naming: variables with CAPITALIZED names hold settings,
2
# you can - and are expected - to modify it; variables with lowercase names
3
# are intermediate variables and macroses not to be modified unless you
4
# know what you're doing.
5
 
6
# Define directories for destination, source repository, sources of kernel, sources of programs.
7
BUILD_DIR:=build
8
REPOSITORY:=../..
9
KERNEL:=$(REPOSITORY)/kernel/trunk
10
PROGS:=$(REPOSITORY)/programs
11
 
3237 clevermous 12
# The main goal: build kolibri.img, kolibri.iso and list for creating a distribution kit
13
all: $(BUILD_DIR)/kolibri.img $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/distr.lst
2817 IgorA 14
 
15
# Docpak requires some documents; we place them
16
# into 'docs' subdir and communicate with FASM
17
# through environment var DOCDIR.
18
DOCDIR:=docs/
19
export DOCDIR
20
 
21
# Because most programs are written in FASM and have
22
# the common structure of one main .asm file possibly including
23
# several .inc files, we handle this case separately.
24
# Namely, we organize one big list of such programs
25
# (FASM_PROGRAMS, see below) containing name of local binary file,
26
# name of file inside kolibri.img and name of the source file.
27
# This list is maintained by hand, and the rest is done with some macroses...
28
# well, slightly complicated macroses - however, you do not need to
29
# understand them in order to maintain the list.
30
# To add a FASM program with one .asm file, just
31
# add the corresponding item to the list and enjoy
32
# the power of GNU make.
33
 
34
# The list of all FASM programs with one main FASM file.
35
# Every item consists of three parts, separated by ':'.
36
# First part is the real name of binary file in $(BUILD_DIR)
37
# as it should be produced by make.
38
# Second part is the name of a file inside kolibri.img,
39
# usually uppercased version of first part - to save space
40
# for FAT filesystem.
41
# Third part is the name of the source file.
42
# Spaces separate items, so spaces in names should be
43
# represented as '|'.
44
FASM_PROGRAMS:=\
45
 @menu:@MENU:$(PROGS)/system/menu/trunk/menu.asm \
46
 @panel:@PANEL:$(PROGS)/system/panel/trunk/@PANEL.ASM \
4132 eAndrew 47
 @docky:@DOCKY:$(PROGS)/system/docky/trunk/docky.asm \
4812 eAndrew 48
 @notify:@NOTIFY:$(PROGS)/system/notify3/notify.asm \
2817 IgorA 49
 @ss:@SS:$(PROGS)/system/ss/trunk/@ss.asm\
50
 refrscrn:REFRSCRN:$(PROGS)/system/refrscrn/refrscrn.asm \
51
 asciivju:ASCIIVJU:$(PROGS)/develop/asciivju/trunk/asciivju.asm \
52
 calc:CALC:$(PROGS)/other/calc/trunk/calc.asm \
53
 calendar:CALENDAR:$(PROGS)/system/calendar/trunk/calendar.asm \
3419 mario79 54
 colrdial:COLRDIAL:$(PROGS)/system/colrdial/color_dialog.asm \
4322 hidnplayr 55
 loaddrv:LOADDRV:$(PROGS)/system/loaddrv/loaddrv.asm \
2817 IgorA 56
 cpu:CPU:$(PROGS)/system/cpu/trunk/cpu.asm \
57
 cpuid:CPUID:$(PROGS)/system/cpuid/trunk/CPUID.ASM \
58
 desktop:DESKTOP:$(PROGS)/system/desktop/trunk/desktop.asm \
59
 disptest:DISPTEST:$(PROGS)/system/disptest/trunk/disptest.ASM \
60
 docpack:DOCPACK:$(PROGS)/system/docpack/trunk/docpack.asm \
61
 end:END:$(PROGS)/system/end/light/end.asm \
4836 mario79 62
 fspeed:FSPEED:$(PROGS)/fs/fspeed/fspeed.asm \
2817 IgorA 63
 gmon:GMON:$(PROGS)/system/gmon/gmon.asm \
64
 hdd_info:HDD_INFO:$(PROGS)/system/hdd_info/trunk/hdd_info.asm \
3897 heavyiron 65
 @icon:@ICON:$(PROGS)/system/icon_new/@icon.asm \
2817 IgorA 66
 cropflat:CROPFLAT:$(PROGS)/system/cropflat/cropflat.asm \
67
 kbd:KBD:$(PROGS)/system/kbd/trunk/kbd.ASM \
68
 kpack:KPACK:$(PROGS)/other/kpack/trunk/kpack.asm \
69
 launcher:LAUNCHER:$(PROGS)/system/launcher/trunk/launcher.asm \
70
 magnify:MAGNIFY:$(PROGS)/demos/magnify/trunk/magnify.asm \
71
 mgb:MGB:$(PROGS)/system/mgb/trunk/mgb.asm \
72
 mousemul:MOUSEMUL:$(PROGS)/system/mousemul/trunk/mousemul.asm \
73
 madmouse:MADMOUSE:$(PROGS)/other/madmouse/madmouse.asm \
74
 mykey:MYKEY:$(PROGS)/system/MyKey/trunk/MyKey.asm \
75
 pcidev:PCIDEV:$(PROGS)/system/pcidev/trunk/PCIDEV.ASM \
76
 rdsave:RDSAVE:$(PROGS)/system/rdsave/trunk/rdsave.asm \
77
 rtfread:RTFREAD:$(PROGS)/other/rtfread/trunk/rtfread.asm \
78
 run:RUN:$(PROGS)/system/run/trunk/run.asm \
3667 mario79 79
 searchap:SEARCHAP:$(PROGS)/system/searchap/searchap.asm \
2817 IgorA 80
 scrshoot:SCRSHOOT:$(PROGS)/media/scrshoot/scrshoot.asm \
81
 setup:SETUP:$(PROGS)/system/setup/trunk/setup.asm \
82
 test:TEST:$(PROGS)/system/test/trunk/test.asm \
83
 tinypad:TINYPAD:$(PROGS)/develop/tinypad/trunk/tinypad.asm \
84
 zkey:ZKEY:$(PROGS)/system/zkey/trunk/ZKEY.ASM \
4466 hidnplayr 85
 terminal:TERMINAL:$(PROGS)/system/terminal/terminal.asm \
2817 IgorA 86
 3d/3dsheart:3D/3DSHEART:$(PROGS)/demos/3dsheart/trunk/3dsheart.asm \
87
 3d/3dwav:3D/3DWAV:$(PROGS)/demos/3dwav/trunk/3dwav.asm \
88
 3d/crownscr:3D/CROWNSCR:$(PROGS)/demos/crownscr/trunk/crownscr.asm  \
89
 3d/free3d04:3D/FREE3D04:$(PROGS)/demos/free3d04/trunk/free3d04.asm \
90
 3d/view3ds:3D/VIEW3DS:$(PROGS)/demos/3DS/VIEW3DS.ASM \
91
 demos/bcdclk:DEMOS/BCDCLK:$(PROGS)/demos/bcdclk/trunk/bcdclk.asm \
92
 demos/circle:DEMOS/CIRCLE:$(PROGS)/develop/examples/circle/trunk/circle.asm \
93
 demos/colorref:DEMOS/COLORREF:$(PROGS)/demos/colorref/trunk/colorref.asm \
94
 demos/cslide:DEMOS/CSLIDE:$(PROGS)/demos/cslide/trunk/cslide.asm \
95
 demos/eyes:DEMOS/EYES:$(PROGS)/demos/eyes/trunk/eyes.asm \
96
 demos/firework:DEMOS/FIREWORK:$(PROGS)/demos/firework/trunk/firework.asm \
97
 demos/movback:DEMOS/MOVBACK:$(PROGS)/demos/movback/trunk/movback.asm \
98
 demos/plasma:DEMOS/PLASMA:$(PROGS)/demos/plasma/trunk/plasma.asm \
99
 demos/tinyfrac:DEMOS/TINYFRAC:$(PROGS)/demos/tinyfrac/trunk/tinyfrac.asm \
100
 demos/trantest:DEMOS/TRANTEST:$(PROGS)/demos/trantest/trunk/trantest.asm \
101
 demos/tube:DEMOS/TUBE:$(PROGS)/demos/tube/trunk/tube.asm \
102
 demos/unvwater:DEMOS/UNVWATER:$(PROGS)/demos/unvwater/trunk/unvwater.asm \
4329 yogev_ezra 103
 demos/use_mb:DEMOS/USE_MB:$(PROGS)/demos/use_mb/use_mb.asm \
2817 IgorA 104
 demos/web:DEMOS/WEB:$(PROGS)/demos/web/trunk/web.asm \
105
 develop/board:DEVELOP/BOARD:$(PROGS)/system/board/trunk/board.asm \
106
 develop/cObj:DEVELOP/cObj:$(PROGS)/develop/cObj/trunk/cObj.asm \
107
 develop/fasm:DEVELOP/FASM:$(PROGS)/develop/fasm/trunk/fasm.asm \
108
 develop/h2d2b:DEVELOP/H2D2B:$(PROGS)/develop/h2d2b/trunk/h2d2b.asm \
109
 develop/heed:DEVELOP/HEED:$(PROGS)/develop/heed/trunk/heed.asm \
110
 develop/keyascii:DEVELOP/KEYASCII:$(PROGS)/develop/keyascii/trunk/keyascii.asm \
111
 develop/mtdbg:DEVELOP/MTDBG:$(PROGS)/develop/mtdbg/mtdbg.asm \
112
 develop/scancode:DEVELOP/SCANCODE:$(PROGS)/develop/scancode/trunk/scancode.asm \
113
 develop/t_edit:DEVELOP/T_EDIT:$(PROGS)/other/t_edit/t_edit.asm \
114
 develop/test_gets:DEVELOP/test_gets:$(PROGS)/develop/libraries/console/examples/test_gets.asm \
4635 mario79 115
 develop/testcon2:DEVELOP/TESTCON2:$(PROGS)/develop/libraries/console/examples/testcon2_eng.asm \
2817 IgorA 116
 develop/thread:DEVELOP/THREAD:$(PROGS)/develop/examples/thread/trunk/thread.asm \
117
 develop/info/asm.syn:DEVELOP/INFO/ASM.SYN:$(PROGS)/other/t_edit/info/asm_syn.asm \
118
 develop/info/cpp_kol_cla.syn:DEVELOP/INFO/CPP_KOL_CLA.SYN:$(PROGS)/other/t_edit/info/cpp_kol_cla_syn.asm \
119
 develop/info/cpp_kol_dar.syn:DEVELOP/INFO/CPP_KOL_DAR.SYN:$(PROGS)/other/t_edit/info/cpp_kol_dar_syn.asm \
120
 develop/info/cpp_kol_def.syn:DEVELOP/INFO/CPP_KOL_DEF.SYN:$(PROGS)/other/t_edit/info/cpp_kol_def_syn.asm \
121
 develop/info/default.syn:DEVELOP/INFO/DEFAULT.SYN:$(PROGS)/other/t_edit/info/default_syn.asm \
122
 develop/info/html.syn:DEVELOP/INFO/HTML.SYN:$(PROGS)/other/t_edit/info/html_syn.asm \
123
 develop/info/ini_files.syn:DEVELOP/INFO/INI_FILES.SYN:$(PROGS)/other/t_edit/info/ini_files_syn.asm \
124
 develop/info/win_const.syn:DEVELOP/INFO/WIN_CONST.SYN:$(PROGS)/other/t_edit/info/win_const_syn.asm \
125
 drivers/com_mouse.obj:DRIVERS/COM_MOUSE.OBJ:$(KERNEL)/drivers/com_mouse.asm \
126
 drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
127
 drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
128
 drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
3086 leency 129
 drivers/intel_hda.obj:DRIVERS/intel_hda.obj:$(REPOSITORY)/drivers/audio/intel_hda/intel_hda.asm \
2817 IgorA 130
 drivers/sb16.obj:DRIVERS/SB16.OBJ:$(KERNEL)/drivers/sb16/sb16.asm \
131
 drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
3172 hidnplayr 132
 drivers/intelac97.obj:DRIVERS/INTELAC97.OBJ:$(KERNEL)/drivers/intelac97.asm \
3709 clevermous 133
 drivers/usbhid.obj:DRIVERS/USBHID.OBJ:$(KERNEL)/drivers/usbhid/usbhid.asm \
3521 clevermous 134
 drivers/usbstor.obj:DRIVERS/USBSTOR.OBJ:$(KERNEL)/drivers/usbstor.asm \
3173 hidnplayr 135
 drivers/vt823x.obj:DRIVERS/VT823X.OBJ:$(KERNEL)/drivers/vt823x.asm \
4999 hidnplayr 136
 drivers/3c59x.obj:DRIVERS/3C59X.OBJ:$(REPOSITORY)/drivers/ethernet/3c59x.asm \
137
 drivers/dec21x4x.obj:DRIVERS/DEC21X4X.OBJ:$(REPOSITORY)/drivers/ethernet/dec21x4x.asm \
138
 drivers/rtl8139.obj:DRIVERS/RTL8139.OBJ:$(REPOSITORY)/drivers/ethernet/RTL8139.asm \
139
 drivers/rtl8169.obj:DRIVERS/RTL8169.OBJ:$(REPOSITORY)/drivers/ethernet/RTL8169.asm \
2817 IgorA 140
 File|Managers/kfar:File|Managers/KFAR:$(PROGS)/fs/kfar/trunk/kfar.asm \
141
 File|Managers/kfm:File|Managers/KFM:$(PROGS)/fs/kfm/trunk/kfm.asm \
142
 File|Managers/opendial:File|Managers/OPENDIAL:$(PROGS)/fs/opendial/opendial.asm \
143
 games/15:GAMES/15:$(PROGS)/games/15/trunk/15.ASM \
144
 games/arcanii:GAMES/ARCANII:$(PROGS)/games/arcanii/trunk/arcanii.asm \
145
 games/freecell:GAMES/FREECELL:$(PROGS)/games/freecell/freecell.asm \
146
 games/gomoku:GAMES/GOMOKU:$(PROGS)/games/gomoku/trunk/gomoku.asm \
147
 games/invaders:GAMES/INVADERS:$(PROGS)/games/invaders/invaders.asm \
148
 games/klavisha:GAMES/KLAVISHA:$(PROGS)/games/klavisha/trunk/klavisha.asm \
149
 games/lines:GAMES/LINES:$(PROGS)/games/lines/lines.asm \
150
 games/mblocks:GAMES/MBLOCKS:$(PROGS)/games/mblocks/trunk/mblocks.asm \
151
 games/msquare:GAMES/MSQUARE:$(PROGS)/games/MSquare/trunk/MSquare.asm \
152
 games/phenix:GAMES/PHENIX:$(PROGS)/games/phenix/trunk/phenix.asm \
153
 games/pipes:GAMES/PIPES:$(PROGS)/games/pipes/pipes.asm \
154
 games/pong:GAMES/PONG:$(PROGS)/games/pong/trunk/pong.asm \
155
 games/pong3:GAMES/PONG3:$(PROGS)/games/pong3/trunk/pong3.asm \
156
 games/rsquare:GAMES/RSQUARE:$(PROGS)/games/rsquare/trunk/rsquare.asm \
157
 games/soko:GAMES/SOKO:$(PROGS)/games/soko/trunk/SOKO.ASM \
158
 games/snake:GAMES/SNAKE:$(PROGS)/games/snake/trunk/snake.asm \
159
 games/sq_game:GAMES/SQ_GAME:$(PROGS)/games/sq_game/trunk/SQ_GAME.ASM \
160
 games/sudoku:GAMES/SUDOKU:$(PROGS)/games/sudoku/trunk/sudoku.asm \
161
 games/sw:GAMES/SW:$(PROGS)/games/sw/trunk/sw.asm \
162
 games/tanks:GAMES/TANKS:$(PROGS)/games/tanks/trunk/tanks.asm \
163
 games/tetris:GAMES/TETRIS:$(PROGS)/games/tetris/trunk/tetris.asm \
164
 lib/archiver.obj:LIB/ARCHIVER.OBJ:$(PROGS)/fs/kfar/trunk/kfar_arc/kfar_arc.asm \
165
 lib/box_lib.obj:LIB/BOX_LIB.OBJ:$(PROGS)/develop/libraries/box_lib/trunk/box_lib.asm \
3104 leency 166
 lib/buf2d.obj:LIB/BUF2D.OBJ:$(PROGS)/develop/libraries/buf2d/trunk/buf2d.asm \
2817 IgorA 167
 lib/console.obj:LIB/CONSOLE.OBJ:$(PROGS)/develop/libraries/console/console.asm \
168
 lib/libgfx.obj:LIB/LIBGFX.OBJ:$(PROGS)/develop/libraries/libs-dev/libgfx/libgfx.asm \
169
 lib/libimg.obj:LIB/LIBIMG.OBJ:$(PROGS)/develop/libraries/libs-dev/libimg/libimg.asm \
170
 lib/libini.obj:LIB/LIBINI.OBJ:$(PROGS)/develop/libraries/libs-dev/libini/libini.asm \
171
 lib/libio.obj:LIB/LIBIO.OBJ:$(PROGS)/develop/libraries/libs-dev/libio/libio.asm \
4331 yogev_ezra 172
 lib/msgbox.obj:LIB/MSGBOX.OBJ:$(PROGS)/develop/libraries/msgbox/msgbox.asm \
2817 IgorA 173
 lib/network.obj:LIB/NETWORK.OBJ:$(PROGS)/develop/libraries/network/network.asm \
4342 yogev_ezra 174
 lib/sort.obj:LIB/SORT.OBJ:$(PROGS)/develop/libraries/sorter/sort.asm \
4253 hidnplayr 175
 lib/http.obj:LIB/HTTP.OBJ:$(PROGS)/develop/libraries/http/http.asm \
2817 IgorA 176
 lib/proc_lib.obj:LIB/PROC_LIB.OBJ:$(PROGS)/develop/libraries/proc_lib/trunk/proc_lib.asm \
177
 lib/cnv_png.obj:LIB/CNV_PNG.OBJ:$(PROGS)/media/zsea/plugins/png/cnv_png.asm \
178
 media/animage:MEDIA/ANIMAGE:$(PROGS)/media/animage/trunk/animage.asm \
179
 media/kiv:MEDIA/KIV:$(PROGS)/media/kiv/trunk/kiv.asm \
180
 media/listplay:MEDIA/LISTPLAY:$(PROGS)/media/listplay/trunk/listplay.asm \
181
 media/midamp:MEDIA/MIDAMP:$(PROGS)/media/midamp/trunk/midamp.asm \
3087 leency 182
 media/palitra:MEDIA/PALITRA:$(PROGS)/media/palitra/trunk/palitra.asm \
2817 IgorA 183
 media/startmus:MEDIA/STARTMUS:$(PROGS)/media/startmus/trunk/STARTMUS.ASM \
3553 hidnplayr 184
 network/ping:NETWORK/PING:$(PROGS)/network/icmp/ping.asm \
185
 network/netcfg:NETWORK/NETCFG:$(PROGS)/network/netcfg/netcfg.asm \
186
 network/netstat:NETWORK/NETSTAT:$(PROGS)/network/netstat/netstat.asm \
187
 network/nslookup:NETWORK/NSLOOKUP:$(PROGS)/network/nslookup/nslookup.asm \
4833 hidnplayr 188
 network/pasta:NETWORK/PASTA:$(PROGS)/network/pasta/pasta.asm \
3553 hidnplayr 189
 network/synergyc:NETWORK/SYNERGYC:$(PROGS)/network/synergyc/synergyc.asm \
190
 network/tcpserv:NETWORK/TCPSERV:$(PROGS)/network/tcpserv/tcpserv.asm \
191
 network/telnet:NETWORK/TELNET:$(PROGS)/network/telnet/telnet.asm \
192
 network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/zeroconf.asm \
3801 hidnplayr 193
 network/ftpc:NETWORK/FTPC:$(PROGS)/network/ftpc/ftpc.asm \
3553 hidnplayr 194
 network/ftpd:NETWORK/FTPD:$(PROGS)/network/ftpd/ftpd.asm \
195
 network/tftpc:NETWORK/TFTPC:$(PROGS)/network/tftpc/tftpc.asm \
196
 network/ircc:NETWORK/IRCC:$(PROGS)/network/ircc/ircc.asm \
3566 hidnplayr 197
 network/downloader:NETWORK/DOWNLOADER:$(PROGS)/network/downloader/downloader.asm \
2817 IgorA 198
# end of list
5039 clevermous 199
# Same as above with PE stripping as extra step.
200
FASM_PROGRAMS_PESTRIP:=\
5040 clevermous 201
 drivers/vidintel.sys:DRIVERS/VIDINTEL.SYS:$(REPOSITORY)/drivers/video/vidintel.asm \
5039 clevermous 202
 drivers/forcedeth.sys:DRIVERS/FORCEDETH.SYS:$(REPOSITORY)/drivers/ethernet/forcedeth.asm \
203
 drivers/i8254x.sys:DRIVERS/I8254X.SYS:$(REPOSITORY)/drivers/ethernet/i8254x.asm \
204
 drivers/i8255x.sys:DRIVERS/I8255X.SYS:$(REPOSITORY)/drivers/ethernet/i8255x.asm \
205
 drivers/mtd80x.sys:DRIVERS/MTD80X.SYS:$(REPOSITORY)/drivers/ethernet/mtd80x.asm \
206
 drivers/pcnet32.sys:DRIVERS/PCNET32.SYS:$(REPOSITORY)/drivers/ethernet/pcnet32.asm \
207
 drivers/r6040.sys:DRIVERS/R6040.SYS:$(REPOSITORY)/drivers/ethernet/R6040.asm \
208
 drivers/rhine.sys:DRIVERS/RHINE.SYS:$(REPOSITORY)/drivers/ethernet/rhine.asm \
209
 drivers/rtl8029.sys:DRIVERS/RTL8029.SYS:$(REPOSITORY)/drivers/ethernet/RTL8029.asm \
210
 drivers/sis900.sys:DRIVERS/SIS900.SYS:$(REPOSITORY)/drivers/ethernet/sis900.asm \
211
 drivers/uhci.sys:DRIVERS/UHCI.SYS:$(REPOSITORY)/drivers/usb/uhci.asm \
212
 drivers/ohci.sys:DRIVERS/OHCI.SYS:$(REPOSITORY)/drivers/usb/ohci.asm \
213
 drivers/ehci.sys:DRIVERS/EHCI.SYS:$(REPOSITORY)/drivers/usb/ehci.asm \
214
 drivers/rdc.sys:DRIVERS/RDC.SYS:$(REPOSITORY)/drivers/video/rdc.asm \
5044 clevermous 215
 drivers/ps2mouse.sys:DRIVERS/PS2MOUSE.SYS:$(REPOSITORY)/drivers/mouse/ps2mouse4d/trunk/ps2mouse.asm \
216
 drivers/tmpdisk.sys:DRIVERS/TMPDISK.SYS:$(REPOSITORY)/drivers/disk/tmpdisk.asm \
5039 clevermous 217
# end of list
2817 IgorA 218
# The list of all FASM programs with one main FASM file for CD image.
219
# Format of an item is exactly the same as in the previous list.
220
FASM_PROGRAMS_CD:=\
221
 drivers/atikms:DRIVERS/ATIKMS:$(REPOSITORY)/drivers/video/drm/radeon/atikms.asm \
3723 mario79 222
 distr_data/zsea:DISTR_DATA/ZSEA:$(PROGS)/media/zsea/zSea.asm \
223
 distr_data/cnv_bmp.obj:DISTR_DATA/CNV_BMP.OBJ:$(PROGS)/media/zsea/plugins/bmp/cnv_bmp.asm \
224
 distr_data/cnv_gif.obj:DISTR_DATA/CNV_GIF.OBJ:$(PROGS)/media/zsea/plugins/gif/cnv_gif.asm \
225
 distr_data/cnv_jpeg.obj:DISTR_DATA/CNV_JPEG.OBJ:$(PROGS)/media/zsea/plugins/jpeg/cnv_jpeg.asm \
226
 distr_data/convert.obj:DISTR_DATA/CONVERT.OBJ:$(PROGS)/media/zsea/plugins/convert/convert.asm \
227
 distr_data/rotate.obj:DISTR_DATA/ROTATE.OBJ:$(PROGS)/media/zsea/plugins/rotate/rotate.asm \
228
 distr_data/scaling.obj:DISTR_DATA/SCALING.OBJ:$(PROGS)/media/zsea/plugins/scaling/scaling.asm \
2817 IgorA 229
# end of list
230
 
231
# The list of all FASM programs which needs to be compiled without KPACKing.
232
FASM_NOKPACK_PROGRAMS:=\
233
 distr_data/9x2klbr.exe:-:$(PROGS)/hd_load/9x2klbr/9x2klbr.asm \
234
 distr_data/MeOSload.com:-:$(PROGS)/hd_load/meosload/MeOSload.asm \
235
 distr_data/mtldr:-:$(PROGS)/hd_load/mtldr/mtldr.asm \
236
 mtldr_for_installer:-:$(PROGS)/hd_load/mtldr_install/mtldr_code/mtldr.asm \
237
 distr_data/mtldr_install.exe:-:$(PROGS)/hd_load/mtldr_install/mtldr_install.asm \
238
 distr_data/MeOSload_for_usb_boot_old.com:-:$(PROGS)/hd_load/usb_boot_old/MeOSload.asm \
239
 distr_data/enable_for_usb_boot_old.exe:-:$(PROGS)/hd_load/usb_boot_old/enable.asm \
240
 distr_data/BOOT_F32.BIN:-:$(PROGS)/hd_load/usb_boot/BOOT_F32.ASM \
241
 distr_data/MTLD_F32:-:$(PROGS)/hd_load/usb_boot/mtldr.asm \
242
 distr_data/inst.exe:-:$(PROGS)/hd_load/usb_boot/inst.asm \
243
 distr_data/setmbr.exe:-:$(PROGS)/hd_load/usb_boot/setmbr.asm \
244
#end of list
245
 
246
# The list of all NASM programs with one main NASM file.
247
# Format of an item is exactly the same as in the previous list.
248
NASM_PROGRAMS:=\
249
 demos/aclock:DEMOS/ACLOCK:$(PROGS)/demos/aclock/trunk/aclock.asm \
4048 clevermous 250
 demos/timer:DEMOS/TIMER:$(PROGS)/other/Timer/Timer.asm \
2817 IgorA 251
 games/c4:GAMES/C4:$(PROGS)/games/c4/trunk/c4.asm \
252
# end of list
253
 
254
# The list of files which should be copied from somewhere.
255
# Format of an item is exactly the same as in the previous list.
256
COPY_FILES:=\
257
 macros.inc:MACROS.INC:$(PROGS)/macros.inc \
258
 config.inc:CONFIG.INC:$(PROGS)/config.inc \
259
 struct.inc:STRUCT.INC:$(PROGS)/struct.inc \
260
 develop/te_icon.png:DEVELOP/TE_ICON.PNG:$(PROGS)/other/t_edit/te_icon.png \
261
 develop/tl_nod_16.png:DEVELOP/TL_NOD_16.PNG:$(PROGS)/other/t_edit/tl_nod_16.png \
262
 develop/tl_sys_16.png:DEVELOP/TL_SYS_16.PNG:$(PROGS)/media/log_el/trunk/tl_sys_16.png \
263
 develop/t_edit.ini:DEVELOP/T_EDIT.INI:$(PROGS)/other/t_edit/t_edit.ini \
264
 File|Managers/z_icons.png:File|Managers/Z_ICONS.PNG:$(PROGS)/fs/opendial/z_icons.png \
265
 File|Managers/kfm_keys.txt:File|Managers/KFM_KEYS.TXT:$(PROGS)/fs/kfm/trunk/docs/english/kfm_keys.txt \
266
 File|Managers/buttons.bmp:File|Managers/BUTTONS.BMP:$(PROGS)/fs/kfm/trunk/buttons.bmp \
267
 File|Managers/icons.bmp:File|Managers/ICONS.BMP:$(PROGS)/fs/kfm/trunk/icons.bmp \
268
 fonts/litt.chr:FONTS/LITT.CHR:$(PROGS)/demos/bgitest/trunk/FONTS/LITT.CHR \
269
 games/snake.ini:GAMES/SNAKE.INI:$(PROGS)/games/snake/trunk/snake.ini \
270
 games/skin.raw:GAMES/SKIN.RAW:$(PROGS)/games/soko/trunk/SKIN.RAW \
271
 games/soko-4.lev:GAMES/SOKO-4.LEV:$(PROGS)/games/soko/trunk/SOKO-4.LEV \
272
 games/soko-5.lev:GAMES/SOKO-5.LEV:$(PROGS)/games/soko/trunk/SOKO-5.LEV \
273
 games/soko-6.lev:GAMES/SOKO-6.LEV:$(PROGS)/games/soko/trunk/SOKO-6.LEV \
274
 games/soko-7.lev:GAMES/SOKO-7.LEV:$(PROGS)/games/soko/trunk/SOKO-7.LEV \
275
 games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \
276
 games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \
277
 media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \
4106 Albom 278
 settings/.shell:SETTINGS/.shell:$(PROGS)/system/shell/bin/eng/.shell \
4099 mario79 279
 settings/mykey.ini:SETTINGS/MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \
4678 leency 280
 network/wv_skin.png:NETWORK/WV_SKIN.PNG:$(PROGS)/cmm/browser/wv_skin.png \
2817 IgorA 281
# end of list
282
 
283
# The list of all C-- programs with one main C-- file.
284
# Format of an item is exactly the same as in the previous list,
285
# except that there can be fourth field with parameters for a compiler.
286
CMM_PROGRAMS:=\
3364 leency 287
 File|Managers/eolite:File|Managers/EOLITE:$(PROGS)/cmm/eolite/Eolite.c \
2817 IgorA 288
 games/clicks:GAMES/CLICKS:$(PROGS)/games/clicks/trunk/clicks.c \
289
 games/FindNumbers:GAMES/FindNumbers:$(PROGS)/games/FindNumbers/trunk/FindNumbers.c-- \
290
 games/flood-it:GAMES/flood-it:$(PROGS)/games/flood-it/trunk/flood-it.c \
291
 games/mine:GAMES/MINE:$(PROGS)/games/mine/trunk/mine.c--:/MEOS \
4660 leency 292
 network/WebView:network/WebView:$(PROGS)/cmm/browser/WebView.c \
3108 leency 293
 tmpdisk:tmpdisk:$(PROGS)/cmm/tmpdisk/tmpdisk.c \
2817 IgorA 294
# end of list
295
 
296
# List of other files to be included in the image file.
297
# Some of them are auto-built with special rules, some just exist before build.
298
# Each item is of the form :.
299
# Spaces should be represented as |.
4095 mario79 300
OTHER_FILES:=settings/autorun.dat:SETTINGS/AUTORUN.DAT \
3102 Akyltist 301
 default.skn:DEFAULT.SKN \
4184 leency 302
 graph:GRAPH \
4094 mario79 303
 settings/icon.ini:SETTINGS/ICON.INI \
4184 leency 304
 ../common/iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
4183 leency 305
 kernel.mnt:KERNEL.MNT \
306
 ../common/kerpack:KERPACK \
4092 mario79 307
 settings/keymap.key:SETTINGS/KEYMAP.KEY \
308
 settings/lang.ini:SETTINGS/LANG.INI \
4183 leency 309
 ../common/kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC \
4096 mario79 310
 settings/menu.dat:SETTINGS/MENU.DAT \
311
 settings/kolibri.lbl:SETTINGS/KOLIBRI.LBL \
4097 mario79 312
 settings/panel.ini:SETTINGS/PANEL.INI \
4132 eAndrew 313
 ../common/settings/docky.ini:SETTINGS/DOCKY.INI \
4812 eAndrew 314
 ../common/notify3.png:NOTIFY3.PNG \
4097 mario79 315
 settings/setup.dat:SETTINGS/SETUP.DAT \
2817 IgorA 316
 shell:SHELL table:TABLE \
4183 leency 317
 ../common/vmode:VMODE 3d/3dsheart:3D/3DSHEART \
4175 leency 318
 ../common/3d/cubeline:3D/CUBELINE \
319
 ../common/3d/gears:3D/GEARS \
320
 ../common/3d/house.3ds:3D/HOUSE.3DS \
4178 leency 321
 ../common/demos/ak47.lif:DEMOS/AK47.LIF \
322
 ../common/demos/life2:DEMOS/LIFE2 \
323
 ../common/demos/relay.lif:DEMOS/RELAY.LIF \
324
 ../common/demos/rpento.lif:DEMOS/RPENTO.LIF \
4177 leency 325
 ../common/File|Managers/eolite.ini:File|Managers/EOLITE.INI \
326
 ../common/File|Managers/icons.ini:File|Managers/ICONS.INI \
327
 ../common/File|Managers/kfar.ini:File|Managers/KFAR.INI \
328
 ../common/File|Managers/kfm.ini:File|Managers/KFM.INI \
2817 IgorA 329
 games/checkers:GAMES/CHECKERS \
330
 games/reversi:GAMES/REVERSI games/rforces:GAMES/RFORCES \
331
 games/xonix:GAMES/XONIX games/megamaze:GAMES/MEGAMAZE \
3136 leency 332
 games/kosilka:GAMES/KOSILKA \
4174 leency 333
 ../common/lib/pixlib.obj:LIB/PIXLIB.OBJ \
4172 leency 334
 ../common/lib/iconv.obj:LIB/ICONV.OBJ \
335
 ../common/lib/netcode.obj:LIB/NETCODE.OBJ \
2817 IgorA 336
 media/ac97snd:MEDIA/AC97SND \
3783 yogev_ezra 337
 ../common/media/ImgF/ImgF:MEDIA/ImgF/ImgF \
338
 ../common/media/ImgF/cEdg.obj:MEDIA/ImgF/cEdg.obj \
339
 ../common/media/ImgF/dither.obj:MEDIA/ImgF/dither.obj \
340
 ../common/media/ImgF/invSol.obj:MEDIA/ImgF/invSol.obj \
4101 mario79 341
 settings/network.ini:SETTINGS/NETWORK.INI \
4182 leency 342
 ../common/network/ftpd.ini:NETWORK/FTPD.INI \
343
 ../common/network/users.ini:NETWORK/USERS.INI \
2817 IgorA 344
#end of list
345
 
346
# Generate skins list understandable by gnu make
347
Makefile.skins: $(REPOSITORY)/skins/authors.txt $(REPOSITORY)/data/generate_makefile_skins.sh
348
	cut -f1 $< | $(SHELL) $(REPOSITORY)/data/generate_makefile_skins.sh > $@
349
include Makefile.skins
350
 
3237 clevermous 351
# Extra targets for the distribution kit and LiveCD image in the syntax of mkisofs
352
EXTRA:=\
2817 IgorA 353
 /=distr_data/autorun.inf \
354
 /=distr_data/KolibriOS_icon.ico \
355
 Skins/=$(REPOSITORY)/skins/authors.txt \
356
 Docs/config.txt=docs/CONFIG.TXT \
357
 Docs/copying.txt=docs/COPYING.TXT \
358
 Docs/hot_keys.txt=docs/HOT_KEYS.TXT \
359
 Docs/install.txt=docs/INSTALL.TXT \
360
 Docs/readme.txt=docs/README.TXT \
361
 Docs/stack.txt=docs/STACK.TXT \
362
 Docs/sysfuncs.txt=docs/SYSFUNCS.TXT \
363
 HD_Load/9x2klbr/=distr_data/9x2klbr.exe \
364
 HD_Load/9x2klbr/=../common/HD_load/9x2klbr/LDKLBR.VXD \
365
 HD_Load/9x2klbr/=$(PROGS)/hd_load/9x2klbr/readme.txt \
366
 HD_Load/MeOSLoad/=distr_data/MeOSload.com \
367
 HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/AUTOEXEC.BAT \
368
 HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/CONFIG.SYS \
369
 HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/L_readme.txt \
370
 HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/L_readme_Win.txt \
371
 HD_Load/mtldr/=distr_data/mtldr \
372
 HD_Load/mtldr/install.txt=$(PROGS)/hd_load/mtldr/install_eng.txt \
373
 HD_Load/mtldr/=$(PROGS)/hd_load/mtldr/vista_install.bat \
374
 HD_Load/mtldr/=$(PROGS)/hd_load/mtldr/vista_remove.bat \
375
 HD_Load/=distr_data/mtldr_install.exe \
376
 HD_Load/memdisk=../common/HD_load/memdisk \
377
 HD_Load/USB_Boot/=distr_data/BOOT_F32.BIN \
378
 HD_Load/USB_Boot/=distr_data/MTLD_F32 \
379
 HD_Load/USB_Boot/=distr_data/inst.exe \
380
 HD_Load/USB_Boot/=distr_data/setmbr.exe \
381
 HD_Load/USB_Boot/readme.txt=$(PROGS)/hd_load/usb_boot/readme_eng.txt \
382
 HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot.rtf \
383
 HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot_866.txt \
384
 HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot_1251.txt \
385
 HD_Load/USB_boot_old/MeOSload.com=distr_data/MeOSload_for_usb_boot_old.com \
386
 HD_Load/USB_boot_old/enable.exe=distr_data/enable_for_usb_boot_old.exe \
3954 clevermous 387
 games/pig=../common/games/pig \
388
 games/soko/soko=games/soko \
389
 games/soko=../common/games/soko/ \
4958 yogev_ezra 390
 kolibrios/emul/dosbox=../common/emul/DosBox \
391
 kolibrios/emul/fceu=../common/emul/fceu \
4955 yogev_ezra 392
 kolibrios/emul/e80/e80=e80 \
393
 kolibrios/emul/gameboy=../common/emul/gameboy \
394
 kolibrios/emul/scummvm=../common/emul/scummvm \
395
 kolibrios/emul/zsnes=../common/emul/zsnes \
4958 yogev_ezra 396
 kolibrios/games/doom=../common/games/doom \
4960 yogev_ezra 397
 kolibrios/games/fara/fara=games/fara \
398
 kolibrios/games/fara/fara.gfx=../common/games/fara.gfx \
4958 yogev_ezra 399
 kolibrios/games/jumpbump=../common/games/jumpbump \
400
 kolibrios/games/quake=../common/games/quake \
401
 kolibrios/games/lrl=../common/games/lrl \
4483 mario79 402
 kolibrios/lib/avcodec-55.dll=../common/lib/avcodec-55.dll \
403
 kolibrios/lib/avdevice-55.dll=../common/lib/avdevice-55.dll \
404
 kolibrios/lib/avformat-55.dll=../common/lib/avformat-55.dll \
405
 kolibrios/lib/avutil-52.dll=../common/lib/avutil-52.dll \
406
 kolibrios/lib/freetype.dll=../common/lib/freetype.dll \
407
 kolibrios/lib/libc.dll=../common/lib/libc.dll \
408
 kolibrios/lib/pixlib.dll=../common/lib/pixlib.dll \
409
 kolibrios/lib/swresample-0.dll=../common/lib/swresample-0.dll \
410
 kolibrios/lib/swscale-2.dll=../common/lib/swscale-2.dll \
411
 kolibrios/lib/zlib.dll=../common/lib/zlib.dll \
3783 yogev_ezra 412
 kolibrios/media/fplay-full=../common/media/fplay-full \
3723 mario79 413
 kolibrios/media/zsea/zsea=distr_data/zsea \
414
 kolibrios/media/zsea/plugins/cnv_bmp.obj=distr_data/cnv_bmp.obj \
415
 kolibrios/media/zsea/plugins/cnv_gif.obj=distr_data/cnv_gif.obj \
416
 kolibrios/media/zsea/plugins/cnv_jpeg.obj=distr_data/cnv_jpeg.obj \
417
 kolibrios/media/zsea/plugins/convert.obj=distr_data/convert.obj \
418
 kolibrios/media/zsea/plugins/rotate.obj=distr_data/rotate.obj \
419
 kolibrios/media/zsea/plugins/scaling.obj=distr_data/scaling.obj \
420
 kolibrios/media/zsea/zsea.ini=$(REPOSITORY)/programs/media/zsea/zSea.ini \
3739 mario79 421
 kolibrios/media/zsea/zsea_keys.txt=$(REPOSITORY)/programs/media/zsea/Docs/zSea_keys_eng.txt \
3723 mario79 422
 kolibrios/media/zsea/buttons/buttons.png=$(REPOSITORY)/programs/media/zsea/buttons.png \
2817 IgorA 423
#end of list
3237 clevermous 424
DISTRIBUTION_EXTRA:=\
425
 $(EXTRA) \
426
 /readme.txt=distr_data/readme_distr.txt \
4086 mario79 427
 /kolibri.lbl=settings/kolibri.lbl \
3237 clevermous 428
#end of list
429
MKISOFS_EXTRA:=\
430
 $(EXTRA) \
431
 /=distr_data/readme.txt \
4086 mario79 432
 /=settings/kolibri.lbl \
3237 clevermous 433
#end of list
2817 IgorA 434
 
435
# Some macro for convenient work.
436
# Macros for replacing '|' to escaped space '\ '.
437
space:=\ #plus space
438
respace=$(subst |,$(space),$(1))
439
# Macro for selecting different parts of ':'-separated items.
440
binarypart=$(word 1,$(subst :, ,$(1)))
441
imagepart=$(word 2,$(subst :, ,$(1)))
442
sourcepart=$(word 3,$(subst :, ,$(1)))
443
parampart=$(word 4,$(subst :, ,$(1)))
444
# Get file names, possibly with spaces inside, from an item.
445
# Here $(f) is an item - in fact, macro argument.
446
fbinary=$(call respace,$(call binarypart,$(f)))
447
fimage=$(call respace,$(call imagepart,$(f)))
448
fsource=$(call respace,$(call sourcepart,$(f)))
449
fparam=$(call respace,$(call parampart,$(f)))
450
 
5039 clevermous 451
# Add stripped PE files produced by fasm to FASM_NOKPACK_PROGRAMS.
452
include Makefile.pestrip
453
FASM_NOKPACK_PROGRAMS:=$(FASM_NOKPACK_PROGRAMS) \
454
 $(foreach f,$(FASM_PROGRAMS_PESTRIP),$(fbinary).full:-:$(fsource))
455
$(foreach f,$(FASM_PROGRAMS_PESTRIP),$(eval $(call pestrip_meta_rule,$(fbinary),$(fbinary).full)))
456
 
2817 IgorA 457
# Define targets for image file.
458
# Join all the lists above.
5039 clevermous 459
targets_full:=$(COPY_FILES) $(FASM_PROGRAMS) $(FASM_PROGRAMS_PESTRIP) $(NASM_PROGRAMS) $(OTHER_FILES) $(CMM_PROGRAMS)
2817 IgorA 460
# For each item in the united list call fbinary.
461
targets:=$(foreach f,$(targets_full),$(fbinary))
462
 
463
# Define a command for copying a file inside the image.
464
# mcopy_command is a macro with two parameters,
465
# local file name $(1) and image file name $(2).
466
# Note that spaces in these have to be escaped with backslashes.
467
mcopy_command=mcopy -moi $(BUILD_DIR)/kolibri.img $(1) ::$(2)
468
# Specialize a previous command for an item $(f) in one of lists.
469
mcopy_item_command=$(call mcopy_command,$(fbinary),$(fimage))
470
 
471
# Join all $(mcopy_item_command) for all items,
472
# append newline after each item.
473
# The first newline character after "define" line and
474
# the last newline character before "endef" line get away
475
# with define/endef, so we make three newline characters,
476
# that is two empty lines, in order to get one in $(newline).
477
define newline
478
 
479
 
480
endef
481
mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
482
 
3237 clevermous 483
# add skins to MKISOFS_EXTRA and DISTRIBUTION_EXTRA
484
allskins:=$(foreach f,$(SKIN_SOURCES),$(call imagepart,$(f))=$(call binarypart,$(f)))
485
MKISOFS_EXTRA:=$(MKISOFS_EXTRA) $(allskins)
486
DISTRIBUTION_EXTRA:=$(DISTRIBUTION_EXTRA) $(allskins)
2817 IgorA 487
# dependencies of MKISOFS_EXTRA; we iterate through $(MKISOFS_EXTRA),
488
# substitute "=" with space, get the 2nd word and join all results
489
mkisofs_extra_targets:=$(call respace,$(foreach f,$(MKISOFS_EXTRA),$(word 2,$(subst =, ,$(f)))))
3237 clevermous 490
distribution_extra_targets:=$(call respace,$(foreach f,$(DISTRIBUTION_EXTRA),$(word 2,$(subst =, ,$(f)))))
2817 IgorA 491
 
3237 clevermous 492
# Define a command for creating a symlink for an item in DISTRIBUTION_EXTRA.
3954 clevermous 493
extra_item_dst=distribution_kit/$(word 1,$(subst =, ,$(f)))
494
extra_item_src=$(word 2,$(subst =, ,$(f)))
495
makelink_item_command=$(if $(notdir $(extra_item_src)), \
496
 ln -sr $(extra_item_src) $(extra_item_dst), \
497
 ln -sr $(extra_item_src)* $(extra_item_dst) \
498
 )
3237 clevermous 499
# Join all $(makelink_command) for all items from DISTRIBUTION_EXTRA.
500
make_distribution_links:=$(foreach f,$(DISTRIBUTION_EXTRA),$(makelink_item_command)$(newline))
501
# Define a command for creating all directories for DISTRIBUTION_EXTRA.
502
# Note that $(sort) removes duplicate entries.
503
distribution_dirs:=$(sort $(foreach f,$(DISTRIBUTION_EXTRA),$(dir distribution_kit/$(word 1,$(subst =, ,$(f))))))
504
make_distribution_dirs:=$(foreach f,$(distribution_dirs),mkdir -p $(f)$(newline))
505
 
2817 IgorA 506
# The first goal: floppy image.
507
$(BUILD_DIR)/kolibri.img: $(BUILD_DIR)/.dir \
508
 Makefile \
509
 $(BUILD_DIR)/boot_fat12.bin \
510
 $(targets)
511
# SYSXTREE
512
	str=`date -u +"[auto-build %d %b %Y %R, r$(REV)]"`; \
513
	echo -n $$str|dd of=kernel.mnt bs=1 seek=`expr 279 - length "$$str"` conv=notrunc 2>/dev/null
514
	dd if=/dev/zero of=$(BUILD_DIR)/kolibri.img count=2880 bs=512 2>&1
515
	mformat -f 1440 -i $(BUILD_DIR)/kolibri.img ::
516
	dd if=$(BUILD_DIR)/boot_fat12.bin of=$(BUILD_DIR)/kolibri.img count=1 bs=512 conv=notrunc 2>&1
517
	mmd -i $(BUILD_DIR)/kolibri.img ::3D
518
	mmd -i $(BUILD_DIR)/kolibri.img ::DEMOS
519
	mmd -i $(BUILD_DIR)/kolibri.img ::DEVELOP
520
	mmd -i $(BUILD_DIR)/kolibri.img ::DEVELOP/INFO
521
	mmd -i $(BUILD_DIR)/kolibri.img ::DRIVERS
522
	mmd -i $(BUILD_DIR)/kolibri.img ::File\ Managers
523
	mmd -i $(BUILD_DIR)/kolibri.img ::FONTS
524
	mmd -i $(BUILD_DIR)/kolibri.img ::GAMES
525
	mmd -i $(BUILD_DIR)/kolibri.img ::LIB
526
	mmd -i $(BUILD_DIR)/kolibri.img ::MEDIA
3224 leency 527
	mmd -i $(BUILD_DIR)/kolibri.img ::MEDIA/ImgF
2817 IgorA 528
	mmd -i $(BUILD_DIR)/kolibri.img ::NETWORK
4087 mario79 529
	mmd -i $(BUILD_DIR)/kolibri.img ::SETTINGS
2817 IgorA 530
	$(mcopy_all_items)
531
 
532
# The second goal: LiveCD image.
533
$(BUILD_DIR)/kolibri.iso: $(BUILD_DIR)/kolibri.img $(mkisofs_extra_targets)
534
	mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points \
535
	-A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "KolibriOS r$(REV)" -sysid "KOLIBRI" \
536
	-iso-level 3 -o $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/kolibri.img $(call respace,$(MKISOFS_EXTRA)) 2>&1
537
 
3237 clevermous 538
# The third goal: distribution list.
539
$(BUILD_DIR)/distr.lst: $(BUILD_DIR)/kolibri.img $(distribution_extra_targets)
540
	rm -rf distribution_kit
541
	$(call respace,$(make_distribution_dirs))
542
	ln -sr $(BUILD_DIR)/kolibri.img distribution_kit/kolibri.img
543
	$(call respace,$(make_distribution_links))
3241 clevermous 544
	touch $(BUILD_DIR)/distr.lst
3237 clevermous 545
 
2817 IgorA 546
# Special targets to modify behaviour of make.
547
.DELETE_ON_ERROR:
548
.SUFFIXES: # delete all predefined rules
549
 
550
# The floppy bootsector.
551
$(BUILD_DIR)/boot_fat12.bin: $(KERNEL)/bootloader/boot_fat12.asm $(KERNEL)/bootloader/floppy1440.inc
552
	fasm $(KERNEL)/bootloader/boot_fat12.asm $(BUILD_DIR)/boot_fat12.bin
553
 
554
$(BUILD_DIR)/.dir 3d/.dir demos/.dir develop/.dir develop/info/.dir drivers/.dir fonts/.dir \
4100 mario79 555
 games/.dir lib/.dir media/.dir network/.dir settings/.dir allskins/.dir distr_data/.dir .deps/.dir:
2817 IgorA 556
	mkdir -p $(dir $@)
557
	touch $@
558
develop/info/.dir: develop/.dir
559
File\ Managers/.dir:
560
	mkdir -p "File Managers"
561
	touch "File Managers/.dir"
562
 
563
# extra dependency for mtldr_install.exe
564
distr_data/mtldr_install.exe: mtldr_for_installer
565
 
566
# FASM black magic goes to Makefile.fasm.
567
include Makefile.fasm
568
 
569
# Similar for NASM.
570
include Makefile.nasm
571
 
572
# Similar for copying files.
573
include Makefile.copy
574
 
4479 dunkaist 575
# Special rules for copying sysfuncs.txt and fasm.txt - they aren't directly included in the image.
576
docpack: $(DOCDIR)SYSFUNCS.TXT $(DOCDIR)FASM.TXT
2817 IgorA 577
$(DOCDIR)SYSFUNCS.TXT: $(KERNEL)/docs/sysfuncs.txt
578
	cp $(KERNEL)/docs/sysfuncs.txt $(DOCDIR)SYSFUNCS.TXT
4479 dunkaist 579
$(DOCDIR)FASM.TXT: $(PROGS)/develop/fasm/trunk/fasm.txt
580
	cp $(PROGS)/develop/fasm/trunk/fasm.txt $(DOCDIR)FASM.TXT
2817 IgorA 581
 
582
# Similar for C--.
583
include Makefile.cmm
584
 
585
# Sorry, even black magic seems to be insufficient for
586
# auto-handling all subtle effects. So we just define
587
# command lines for compiling and linking, and
588
# maintain the list of sources and objects by hand.
589
include Makefile.msvc
590
 
591
# Rules for table
592
table: .obj.table/table.exe
593
	$(msvc_final)
594
TABLE_OBJECTS:=.obj.table/calc.obj .obj.table/func.obj .obj.table/hello.obj \
595
 .obj.table/KosFile.obj .obj.table/kosSyst.obj .obj.table/math2.obj \
596
 .obj.table/mcsmemm.obj .obj.table/parser.obj
597
TABLE_H_FILES:=$(wildcard $(PROGS)/other/table/*.h)
598
.obj.table/table.exe: $(TABLE_OBJECTS)
599
	$(msvc_link)
600
$(TABLE_OBJECTS): .obj.table/%.obj: $(PROGS)/other/table/%.cpp $(TABLE_H_FILES) Makefile.msvc | .obj.table
601
	$(msvc_compile)
602
.obj.table:
603
	mkdir -p .obj.table
604
 
605
# Rules for graph
606
graph: .obj.graph/graph.exe
607
	$(msvc_final)
608
GRAPH_CPP_OBJECTS:=.obj.graph/func.obj .obj.graph/hello.obj .obj.graph/kolibri.obj \
609
 .obj.graph/KosFile.obj .obj.graph/kosSyst.obj .obj.graph/math2.obj \
610
 .obj.graph/mcsmemm.obj .obj.graph/parser.obj
611
GRAPH_C_OBJECTS:=.obj.graph/string.obj
612
GRAPH_H_FILES:=$(wildcard $(PROGS)/other/graph/*.h)
613
GRAPH_FASM_OBJECTS:=.obj.graph/memcpy.obj .obj.graph/memset.obj
614
.obj.graph/graph.exe: $(GRAPH_CPP_OBJECTS) $(GRAPH_C_OBJECTS) $(GRAPH_FASM_OBJECTS)
615
	$(msvc_link)
616
$(GRAPH_CPP_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.cpp $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
617
	$(msvc_compile)
618
$(GRAPH_C_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.c $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
619
	$(msvc_compile)
620
$(GRAPH_FASM_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.asm Makefile.msvc | .obj.graph
621
	fasm $< $@
622
.obj.graph:
623
	mkdir -p .obj.graph
624
 
625
# Rules for kosilka
626
games/kosilka: .obj.kosilka/kosilka.exe
627
	$(msvc_final)
628
KOSILKA_OBJECTS:=.obj.kosilka/kosilka.obj .obj.kosilka/KosFile.obj .obj.kosilka/kosSyst.obj .obj.kosilka/mcsmemm.obj
629
KOSILKA_H_FILES:=$(PROGS)/games/kosilka/*.h
630
.obj.kosilka/kosilka.exe: $(KOSILKA_OBJECTS)
631
	$(msvc_link)
632
$(KOSILKA_OBJECTS): .obj.kosilka/%.obj: $(PROGS)/games/kosilka/%.cpp $(KOSILKA_H_FILES) Makefile.msvc | .obj.kosilka
633
	$(msvc_compile)
634
.obj.kosilka:
635
	mkdir -p .obj.kosilka
636
 
637
include Makefile.gcc
638
 
639
# Rules for shell
640
shell: .obj.shell/start.o .obj.shell/shell.o .obj.shell/kolibri.o .obj.shell/stdlib.o .obj.shell/string.o .obj.shell/ctype.o \
641
 $(PROGS)/system/shell/kolibri.ld
642
	$(call gcc_link,$(PROGS)/system/shell/kolibri.ld)
643
.obj.shell/shell.o: $(PROGS)/system/shell/shell.c \
644
 $(PROGS)/system/shell/all.h \
645
 $(PROGS)/system/shell/system/*.h \
646
 $(PROGS)/system/shell/cmd/*.c \
647
 $(PROGS)/system/shell/modules/*.c \
648
 $(PROGS)/system/shell/locale/rus/globals.h \
649
 Makefile.gcc | .obj.shell
650
	$(gcc_compile)
651
.obj.shell/kolibri.o .obj.shell/stdlib.o .obj.shell/string.o .obj.shell/ctype.o: .obj.shell/%.o: \
652
 $(PROGS)/system/shell/system/%.c $(PROGS)/system/shell/system/*.h \
653
 Makefile.gcc | .obj.shell
654
	$(gcc_compile)
655
	win32-gcc -c -Os -o $@ $<
656
.obj.shell/start.o: $(PROGS)/system/shell/start.asm | .obj.shell
657
	fasm $< $@
658
.obj.shell:
659
	mkdir -p .obj.shell
660
 
661
# Rules for e80
662
E80DIR=$(PROGS)/emulator/e80/trunk
663
e80: .obj.e80/start.o .obj.e80/kolibri.o .obj.e80/stdlib.o .obj.e80/string.o .obj.e80/z80.o .obj.e80/e80.o
664
	$(call gcc_link,$(E80DIR)/kolibri.ld)
665
.obj.e80/e80.o: $(E80DIR)/e80.c $(E80DIR)/48.h \
666
 $(E80DIR)/system/*.h $(E80DIR)/system/msgbox.c \
667
 $(E80DIR)/z80/z80.h Makefile.gcc | .obj.e80
668
	$(gcc_compile)
669
.obj.e80/kolibri.o .obj.e80/stdlib.o .obj.e80/string.o: .obj.e80/%.o: \
670
 $(E80DIR)/system/%.c $(E80DIR)/system/*.h Makefile.gcc | .obj.e80
671
	$(gcc_compile)
672
.obj.e80/z80.o: $(E80DIR)/z80/z80.c $(E80DIR)/z80/*
673
	$(gcc_compile)
674
.obj.e80/start.o: $(E80DIR)/asm_code.asm | .obj.e80
675
	fasm $< $@
676
.obj.e80:
677
	mkdir -p .obj.e80
678
 
679
# Rules for sdk/sound, used by media/ac97snd
680
SOUNDDIR=$(PROGS)/develop/sdk/trunk/sound/src
681
SOUND_OBJECTS:=$(patsubst $(SOUNDDIR)/%.asm,.sdk/%.obj,$(wildcard $(SOUNDDIR)/*.asm))
682
SOUND_INC_FILES:=$(wildcard $(SOUNDDIR)/*.inc)
683
.sdk/sound.lib: $(SOUND_OBJECTS)
684
	win32-link /lib /out:$@ $^
685
$(SOUND_OBJECTS): .sdk/%.obj: $(SOUNDDIR)/%.asm $(SOUND_INC_FILES) | .sdk
686
	fasm $< $@
687
.sdk:
688
	mkdir -p .sdk
689
# Rules for media/ac97snd
690
AC97DIR=$(PROGS)/media/ac97snd
691
media/ac97snd: .obj.ac97snd/ac97snd.exe
692
	$(msvc_final)
693
.obj.ac97snd/ac97snd.exe: .obj.ac97snd/ac97wav.obj .obj.ac97snd/crt.obj .obj.ac97snd/k_lib.obj \
694
	.obj.ac97snd/mpg.lib .sdk/sound.lib .obj.ac97snd/ufmod.obj
695
	$(msvc_link)
696
.obj.ac97snd/ac97wav.obj: $(AC97DIR)/ac97snd/ac97wav.c \
697
	$(AC97DIR)/kolibri.h $(AC97DIR)/ac97snd/ac97wav.h $(AC97DIR)/mpg/mpg123.h \
698
	$(AC97DIR)/sound.h $(AC97DIR)/ufmod-codec.h Makefile.msvc | .obj.ac97snd
699
	$(msvc_compile)
700
.obj.ac97snd/crt.obj: $(AC97DIR)/ac97snd/crt.c $(AC97DIR)/ac97snd/crt.h Makefile.msvc | .obj.ac97snd
701
	$(msvc_compile)
702
.obj.ac97snd/k_lib.obj: $(AC97DIR)/ac97snd/k_lib.asm $(AC97DIR)/ac97snd/proc32.inc | .obj.ac97snd
703
	fasm $< $@
704
.obj.ac97snd/ufmod.obj: $(AC97DIR)/ufmod-config.asm | .obj.ac97snd
705
	fasm $< $@ -s .deps/ac97snd-ufmod.fas
706
	prepsrc .deps/ac97snd-ufmod.fas /dev/stdout | \
707
	perl -n -e 's|\\|/|g;s| |\\ |g;push @a,$$1 if/^;include\\ \x27(.*?)\x27/;' \
708
	-e 'END{$$a=join " \\\n ",@a;print "$@: $$a\n$$a:\n"}' > .deps/ac97snd-ufmod.Po
709
-include .deps/ac97snd-ufmod.Po
710
AC97SND_MPG_C_FILES:=$(wildcard $(AC97DIR)/mpg/*.c)
711
AC97SND_MPG_H_FILES:=$(wildcard $(AC97DIR)/mpg/*.h)
712
AC97SND_MPG_C_OBJECTS:=$(patsubst $(AC97DIR)/mpg/%.c,.obj.ac97snd/%.o,$(AC97SND_MPG_C_FILES))
713
.obj.ac97snd/mpg.lib: $(AC97SND_MPG_C_OBJECTS) .obj.ac97snd/pow.obj
714
	win32-link /lib /ltcg /out:$@ $^
715
$(AC97SND_MPG_C_OBJECTS): .obj.ac97snd/%.o: $(AC97DIR)/mpg/%.c $(AC97SND_MPG_H_FILES) Makefile.msvc | .obj.ac97snd
716
	$(msvc_compile)
717
.obj.ac97snd/pow.obj: $(AC97DIR)/mpg/pow.asm $(AC97DIR)/mpg/proc32.inc | .obj.ac97snd
718
	fasm $< $@
719
.obj.ac97snd:
720
	mkdir -p .obj.ac97snd
721
 
722
# Rules for atikms.dll
723
# Use Makefile from $(REPOSITORY)/drivers/ddk and $(REPOSITORY)/drivers/video/drm/radeon
724
# However, dependencies must be duplicated - I don't know how to avoid this
725
# without need to rebuild kolibri.img at every iteration...
726
# Note that we are going to write in the directory shared
727
# between all Makefiles, so we need locked operations.
728
drivers/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll drivers/.dir
729
	kpack --nologo $< $@
730
$(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/Makefile.lto
731
	flock $(REPOSITORY)/drivers/video/drm/radeon/.lock \
732
	$(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/video/drm/radeon -f Makefile.lto
733
$(REPOSITORY)/drivers/ddk/libddk.a: $(REPOSITORY)/drivers/ddk/Makefile
734
	flock $(REPOSITORY)/drivers/ddk/.lock \
735
	$(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libddk.a
736
$(REPOSITORY)/drivers/ddk/libcore.a: $(REPOSITORY)/drivers/ddk/Makefile
737
	flock $(REPOSITORY)/drivers/ddk/.lock \
738
	$(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libcore.a
739
# dependencies
740
$(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: \
741
 $(REPOSITORY)/drivers/video/drm/radeon/atikms.lds \
742
 $(REPOSITORY)/drivers/ddk/libddk.a \
743
 $(REPOSITORY)/drivers/ddk/libcore.a \
744
 $(REPOSITORY)/drivers/video/drm/radeon/*.[Sch] \
745
 $(REPOSITORY)/drivers/video/drm/radeon/*.asm \
746
 $(REPOSITORY)/drivers/video/drm/radeon/Makefile \
747
 $(REPOSITORY)/drivers/video/drm/radeon/firmware/*.bin \
748
 $(REPOSITORY)/drivers/include/*.h \
749
 $(REPOSITORY)/drivers/include/*/*.h \
750
 $(REPOSITORY)/drivers/include/*/*/*.h \
751
 $(REPOSITORY)/drivers/include/*/*/*/*.h
752
$(REPOSITORY)/drivers/ddk/libddk.a: \
753
 $(REPOSITORY)/drivers/ddk/*/* \
754
 $(REPOSITORY)/drivers/include/*.h \
755
 $(REPOSITORY)/drivers/include/*/*.h \
756
 $(REPOSITORY)/drivers/include/*/*/*.h \
757
 $(REPOSITORY)/drivers/include/*/*/*/*.h
758
$(REPOSITORY)/drivers/ddk/libcore.a: \
4963 eAndrew 759
 $(REPOSITORY)/drivers/ddk/core.S