Subversion Repositories Kolibri OS

Rev

Rev 5073 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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