Subversion Repositories Kolibri OS

Rev

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

  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.  
  12. # The main goal: build kolibri.img and kolibri.iso
  13. all: $(BUILD_DIR)/kolibri.img $(BUILD_DIR)/kolibri.iso
  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.  @clip:@CLIP:$(PROGS)/system/clip/trunk/@clip.ASM \
  46.  @menu:@MENU:$(PROGS)/system/menu/trunk/menu.asm \
  47.  @notify:@NOTIFY:$(PROGS)/system/notify/trunk/@notify.asm \
  48.  @panel:@PANEL:$(PROGS)/system/panel/trunk/@PANEL.ASM \
  49.  @rb:@RB:$(PROGS)/system/rb/trunk/@RB.ASM \
  50.  @ss:@SS:$(PROGS)/system/ss/trunk/@ss.asm\
  51.  refrscrn:REFRSCRN:$(PROGS)/system/refrscrn/refrscrn.asm \
  52.  asciivju:ASCIIVJU:$(PROGS)/develop/asciivju/trunk/asciivju.asm \
  53.  calc:CALC:$(PROGS)/other/calc/trunk/calc.asm \
  54.  calendar:CALENDAR:$(PROGS)/system/calendar/trunk/calendar.asm \
  55.  commouse:COMMOUSE:$(PROGS)/system/commouse/trunk/commouse.asm \
  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 \
  62.  gmon:GMON:$(PROGS)/system/gmon/gmon.asm \
  63.  hdd_info:HDD_INFO:$(PROGS)/system/hdd_info/trunk/hdd_info.asm \
  64.  icon:ICON:$(PROGS)/system/icon/trunk/icon.asm \
  65.  cropflat:CROPFLAT:$(PROGS)/system/cropflat/cropflat.asm \
  66.  kbd:KBD:$(PROGS)/system/kbd/trunk/kbd.ASM \
  67.  kpack:KPACK:$(PROGS)/other/kpack/trunk/kpack.asm \
  68.  launcher:LAUNCHER:$(PROGS)/system/launcher/trunk/launcher.asm \
  69.  magnify:MAGNIFY:$(PROGS)/demos/magnify/trunk/magnify.asm \
  70.  mgb:MGB:$(PROGS)/system/mgb/trunk/mgb.asm \
  71.  mousemul:MOUSEMUL:$(PROGS)/system/mousemul/trunk/mousemul.asm \
  72.  madmouse:MADMOUSE:$(PROGS)/other/madmouse/madmouse.asm \
  73.  mykey:MYKEY:$(PROGS)/system/MyKey/trunk/MyKey.asm \
  74.  pcidev:PCIDEV:$(PROGS)/system/pcidev/trunk/PCIDEV.ASM \
  75.  period:PERIOD:$(PROGS)/other/period/trunk/period.asm \
  76.  pic4:PIC4:$(PROGS)/media/pic4/trunk/pic4.asm \
  77.  rdsave:RDSAVE:$(PROGS)/system/rdsave/trunk/rdsave.asm \
  78.  rtfread:RTFREAD:$(PROGS)/other/rtfread/trunk/rtfread.asm \
  79.  run:RUN:$(PROGS)/system/run/trunk/run.asm \
  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 \
  85.  3d/3dcube2:3D/3DCUBE2:$(PROGS)/demos/3dcube2/trunk/3DCUBE2.ASM \
  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/flatwav:3D/FLATWAV:$(PROGS)/demos/flatwav/trunk/FLATWAV.ASM \
  90.  3d/free3d04:3D/FREE3D04:$(PROGS)/demos/free3d04/trunk/free3d04.asm \
  91.  3d/view3ds:3D/VIEW3DS:$(PROGS)/demos/3DS/VIEW3DS.ASM \
  92.  demos/bcdclk:DEMOS/BCDCLK:$(PROGS)/demos/bcdclk/trunk/bcdclk.asm \
  93.  demos/circle:DEMOS/CIRCLE:$(PROGS)/develop/examples/circle/trunk/circle.asm \
  94.  demos/colorref:DEMOS/COLORREF:$(PROGS)/demos/colorref/trunk/colorref.asm \
  95.  demos/cslide:DEMOS/CSLIDE:$(PROGS)/demos/cslide/trunk/cslide.asm \
  96.  demos/eyes:DEMOS/EYES:$(PROGS)/demos/eyes/trunk/eyes.asm \
  97.  demos/fire:DEMOS/FIRE:$(PROGS)/demos/fire/trunk/fire.asm \
  98.  demos/firework:DEMOS/FIREWORK:$(PROGS)/demos/firework/trunk/firework.asm \
  99.  demos/movback:DEMOS/MOVBACK:$(PROGS)/demos/movback/trunk/movback.asm \
  100.  demos/plasma:DEMOS/PLASMA:$(PROGS)/demos/plasma/trunk/plasma.asm \
  101.  demos/timer:DEMOS/TIMER:$(PROGS)/demos/timer/trunk/timer.asm \
  102.  demos/tinyfrac:DEMOS/TINYFRAC:$(PROGS)/demos/tinyfrac/trunk/tinyfrac.asm \
  103.  demos/trantest:DEMOS/TRANTEST:$(PROGS)/demos/trantest/trunk/trantest.asm \
  104.  demos/tube:DEMOS/TUBE:$(PROGS)/demos/tube/trunk/tube.asm \
  105.  demos/unvwater:DEMOS/UNVWATER:$(PROGS)/demos/unvwater/trunk/unvwater.asm \
  106.  demos/web:DEMOS/WEB:$(PROGS)/demos/web/trunk/web.asm \
  107.  develop/board:DEVELOP/BOARD:$(PROGS)/system/board/trunk/board.asm \
  108.  develop/cObj:DEVELOP/cObj:$(PROGS)/develop/cObj/trunk/cObj.asm \
  109.  develop/fasm:DEVELOP/FASM:$(PROGS)/develop/fasm/trunk/fasm.asm \
  110.  develop/h2d2b:DEVELOP/H2D2B:$(PROGS)/develop/h2d2b/trunk/h2d2b.asm \
  111.  develop/heed:DEVELOP/HEED:$(PROGS)/develop/heed/trunk/heed.asm \
  112.  develop/ipc:DEVELOP/IPC:$(PROGS)/network/ipc/trunk/ipc.asm \
  113.  develop/keyascii:DEVELOP/KEYASCII:$(PROGS)/develop/keyascii/trunk/keyascii.asm \
  114.  develop/mtdbg:DEVELOP/MTDBG:$(PROGS)/develop/mtdbg/mtdbg.asm \
  115.  develop/scancode:DEVELOP/SCANCODE:$(PROGS)/develop/scancode/trunk/scancode.asm \
  116.  develop/t_edit:DEVELOP/T_EDIT:$(PROGS)/other/t_edit/t_edit.asm \
  117.  develop/test_gets:DEVELOP/test_gets:$(PROGS)/develop/libraries/console/examples/test_gets.asm \
  118.  develop/testcon2:DEVELOP/TESTCON2:$(PROGS)/develop/libraries/console/examples/testcon2.asm \
  119.  develop/thread:DEVELOP/THREAD:$(PROGS)/develop/examples/thread/trunk/thread.asm \
  120.  develop/info/asm.syn:DEVELOP/INFO/ASM.SYN:$(PROGS)/other/t_edit/info/asm_syn.asm \
  121.  develop/info/cpp_kol_cla.syn:DEVELOP/INFO/CPP_KOL_CLA.SYN:$(PROGS)/other/t_edit/info/cpp_kol_cla_syn.asm \
  122.  develop/info/cpp_kol_dar.syn:DEVELOP/INFO/CPP_KOL_DAR.SYN:$(PROGS)/other/t_edit/info/cpp_kol_dar_syn.asm \
  123.  develop/info/cpp_kol_def.syn:DEVELOP/INFO/CPP_KOL_DEF.SYN:$(PROGS)/other/t_edit/info/cpp_kol_def_syn.asm \
  124.  develop/info/default.syn:DEVELOP/INFO/DEFAULT.SYN:$(PROGS)/other/t_edit/info/default_syn.asm \
  125.  develop/info/html.syn:DEVELOP/INFO/HTML.SYN:$(PROGS)/other/t_edit/info/html_syn.asm \
  126.  develop/info/ini_files.syn:DEVELOP/INFO/INI_FILES.SYN:$(PROGS)/other/t_edit/info/ini_files_syn.asm \
  127.  develop/info/win_const.syn:DEVELOP/INFO/WIN_CONST.SYN:$(PROGS)/other/t_edit/info/win_const_syn.asm \
  128.  drivers/com_mouse.obj:DRIVERS/COM_MOUSE.OBJ:$(KERNEL)/drivers/com_mouse.asm \
  129.  drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
  130.  drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
  131.  drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
  132.  drivers/ps2mouse.obj:DRIVERS/PS2MOUSE.OBJ:$(REPOSITORY)/drivers/mouse/ps2mouse4d/trunk/ps2mouse.asm \
  133.  drivers/sb16.obj:DRIVERS/SB16.OBJ:$(KERNEL)/drivers/sb16/sb16.asm \
  134.  drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
  135.  drivers/vt8235.obj:DRIVERS/VT8235.OBJ:$(KERNEL)/drivers/vt823x.asm \
  136.  File|Managers/kfar:File|Managers/KFAR:$(PROGS)/fs/kfar/trunk/kfar.asm \
  137.  File|Managers/kfm:File|Managers/KFM:$(PROGS)/fs/kfm/trunk/kfm.asm \
  138.  File|Managers/opendial:File|Managers/OPENDIAL:$(PROGS)/fs/opendial/opendial.asm \
  139.  games/15:GAMES/15:$(PROGS)/games/15/trunk/15.ASM \
  140.  games/arcanii:GAMES/ARCANII:$(PROGS)/games/arcanii/trunk/arcanii.asm \
  141.  games/freecell:GAMES/FREECELL:$(PROGS)/games/freecell/freecell.asm \
  142.  games/gomoku:GAMES/GOMOKU:$(PROGS)/games/gomoku/trunk/gomoku.asm \
  143.  games/invaders:GAMES/INVADERS:$(PROGS)/games/invaders/invaders.asm \
  144.  games/klavisha:GAMES/KLAVISHA:$(PROGS)/games/klavisha/trunk/klavisha.asm \
  145.  games/lines:GAMES/LINES:$(PROGS)/games/lines/lines.asm \
  146.  games/mblocks:GAMES/MBLOCKS:$(PROGS)/games/mblocks/trunk/mblocks.asm \
  147.  games/msquare:GAMES/MSQUARE:$(PROGS)/games/MSquare/trunk/MSquare.asm \
  148.  games/phenix:GAMES/PHENIX:$(PROGS)/games/phenix/trunk/phenix.asm \
  149.  games/pipes:GAMES/PIPES:$(PROGS)/games/pipes/pipes.asm \
  150.  games/pong:GAMES/PONG:$(PROGS)/games/pong/trunk/pong.asm \
  151.  games/pong3:GAMES/PONG3:$(PROGS)/games/pong3/trunk/pong3.asm \
  152.  games/rsquare:GAMES/RSQUARE:$(PROGS)/games/rsquare/trunk/rsquare.asm \
  153.  games/soko:GAMES/SOKO:$(PROGS)/games/soko/trunk/SOKO.ASM \
  154.  games/snake:GAMES/SNAKE:$(PROGS)/games/snake/trunk/snake.asm \
  155.  games/sq_game:GAMES/SQ_GAME:$(PROGS)/games/sq_game/trunk/SQ_GAME.ASM \
  156.  games/sudoku:GAMES/SUDOKU:$(PROGS)/games/sudoku/trunk/sudoku.asm \
  157.  games/sw:GAMES/SW:$(PROGS)/games/sw/trunk/sw.asm \
  158.  games/tanks:GAMES/TANKS:$(PROGS)/games/tanks/trunk/tanks.asm \
  159.  games/tetris:GAMES/TETRIS:$(PROGS)/games/tetris/trunk/tetris.asm \
  160.  lib/archiver.obj:LIB/ARCHIVER.OBJ:$(PROGS)/fs/kfar/trunk/kfar_arc/kfar_arc.asm \
  161.  lib/box_lib.obj:LIB/BOX_LIB.OBJ:$(PROGS)/develop/libraries/box_lib/trunk/box_lib.asm \
  162.  lib/console.obj:LIB/CONSOLE.OBJ:$(PROGS)/develop/libraries/console/console.asm \
  163.  lib/libgfx.obj:LIB/LIBGFX.OBJ:$(PROGS)/develop/libraries/libs-dev/libgfx/libgfx.asm \
  164.  lib/libimg.obj:LIB/LIBIMG.OBJ:$(PROGS)/develop/libraries/libs-dev/libimg/libimg.asm \
  165.  lib/libini.obj:LIB/LIBINI.OBJ:$(PROGS)/develop/libraries/libs-dev/libini/libini.asm \
  166.  lib/libio.obj:LIB/LIBIO.OBJ:$(PROGS)/develop/libraries/libs-dev/libio/libio.asm \
  167.  lib/network.obj:LIB/NETWORK.OBJ:$(PROGS)/develop/libraries/network/network.asm \
  168.  lib/proc_lib.obj:LIB/PROC_LIB.OBJ:$(PROGS)/develop/libraries/proc_lib/trunk/proc_lib.asm \
  169.  lib/cnv_png.obj:LIB/CNV_PNG.OBJ:$(PROGS)/media/zsea/plugins/png/cnv_png.asm \
  170.  media/animage:MEDIA/ANIMAGE:$(PROGS)/media/animage/trunk/animage.asm \
  171.  media/cdp:MEDIA/CDP:$(PROGS)/media/cdp/trunk/cdp.asm \
  172.  media/kiv:MEDIA/KIV:$(PROGS)/media/kiv/trunk/kiv.asm \
  173.  media/listplay:MEDIA/LISTPLAY:$(PROGS)/media/listplay/trunk/listplay.asm \
  174.  media/midamp:MEDIA/MIDAMP:$(PROGS)/media/midamp/trunk/midamp.asm \
  175.  media/startmus:MEDIA/STARTMUS:$(PROGS)/media/startmus/trunk/STARTMUS.ASM \
  176.  network/airc:NETWORK/AIRC:$(PROGS)/network/airc/trunk/airc.asm \
  177.  network/arpstat:NETWORK/ARPSTAT:$(PROGS)/network/arpstat/trunk/arpstat.asm \
  178.  network/chess:NETWORK/CHESS:$(PROGS)/network/chess/trunk/chess.asm \
  179.  network/downloader:NETWORK/DOWNLOADER:$(PROGS)/network/downloader/trunk/downloader.asm \
  180.  network/ethstat:NETWORK/ETHSTAT:$(PROGS)/network/ethstat/trunk/ethstat.asm \
  181.  network/ftps:NETWORK/FTPS:$(PROGS)/network/ftps/trunk/FTPS.ASM \
  182.  network/https:NETWORK/HTTPS:$(PROGS)/network/https/trunk/https.asm \
  183.  network/nntpc:NETWORK/NNTPC:$(PROGS)/network/nntpc/trunk/nntpc.asm \
  184.  network/nslookup:NETWORK/NSLOOKUP:$(PROGS)/develop/libraries/network/examples/nslookup.asm \
  185.  network/popc:NETWORK/POPC:$(PROGS)/network/popc/trunk/popc.asm \
  186.  network/smtps:NETWORK/SMTPS:$(PROGS)/network/smtps/trunk/smtps.asm \
  187.  network/stackcfg:NETWORK/STACKCFG:$(PROGS)/network/stackcfg/trunk/stackcfg.asm \
  188.  network/telnet:NETWORK/TELNET:$(PROGS)/network/telnet/trunk/telnet.asm \
  189.  network/tftpc:NETWORK/TFTPC:$(PROGS)/network/tftpc/trunk/tftpc.asm \
  190.  network/VNCclient:NETWORK/VNCclient:$(PROGS)/network/VNCclient/VNCclient.asm \
  191.  network/ym:NETWORK/YM:$(PROGS)/network/ym/trunk/ym.asm \
  192.  network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
  193. # end of list
  194. # The list of all FASM programs with one main FASM file for CD image.
  195. # Format of an item is exactly the same as in the previous list.
  196. FASM_PROGRAMS_CD:=\
  197.  drivers/atikms:DRIVERS/ATIKMS:$(REPOSITORY)/drivers/video/drm/radeon/atikms.asm \
  198. # end of list
  199.  
  200. # The list of all FASM programs which needs to be compiled without KPACKing.
  201. FASM_NOKPACK_PROGRAMS:=\
  202.  distr_data/9x2klbr.exe:-:$(PROGS)/hd_load/9x2klbr/9x2klbr.asm \
  203.  distr_data/MeOSload.com:-:$(PROGS)/hd_load/meosload/MeOSload.asm \
  204.  distr_data/mtldr:-:$(PROGS)/hd_load/mtldr/mtldr.asm \
  205.  mtldr_for_installer:-:$(PROGS)/hd_load/mtldr_install/mtldr_code/mtldr.asm \
  206.  distr_data/mtldr_install.exe:-:$(PROGS)/hd_load/mtldr_install/mtldr_install.asm \
  207.  distr_data/MeOSload_for_usb_boot_old.com:-:$(PROGS)/hd_load/usb_boot_old/MeOSload.asm \
  208.  distr_data/enable_for_usb_boot_old.exe:-:$(PROGS)/hd_load/usb_boot_old/enable.asm \
  209.  distr_data/BOOT_F32.BIN:-:$(PROGS)/hd_load/usb_boot/BOOT_F32.ASM \
  210.  distr_data/MTLD_F32:-:$(PROGS)/hd_load/usb_boot/mtldr.asm \
  211.  distr_data/inst.exe:-:$(PROGS)/hd_load/usb_boot/inst.asm \
  212.  distr_data/setmbr.exe:-:$(PROGS)/hd_load/usb_boot/setmbr.asm \
  213. #end of list
  214.  
  215. # The list of all NASM programs with one main NASM file.
  216. # Format of an item is exactly the same as in the previous list.
  217. NASM_PROGRAMS:=\
  218.  demos/aclock:DEMOS/ACLOCK:$(PROGS)/demos/aclock/trunk/aclock.asm \
  219.  games/c4:GAMES/C4:$(PROGS)/games/c4/trunk/c4.asm \
  220. # end of list
  221.  
  222. # The list of files which should be copied from somewhere.
  223. # Format of an item is exactly the same as in the previous list.
  224. COPY_FILES:=\
  225.  macros.inc:MACROS.INC:$(PROGS)/macros.inc \
  226.  config.inc:CONFIG.INC:$(PROGS)/config.inc \
  227.  struct.inc:STRUCT.INC:$(PROGS)/struct.inc \
  228.  develop/te_icon.png:DEVELOP/TE_ICON.PNG:$(PROGS)/other/t_edit/te_icon.png \
  229.  develop/tl_nod_16.png:DEVELOP/TL_NOD_16.PNG:$(PROGS)/other/t_edit/tl_nod_16.png \
  230.  develop/tl_sys_16.png:DEVELOP/TL_SYS_16.PNG:$(PROGS)/media/log_el/trunk/tl_sys_16.png \
  231.  File|Managers/z_icons.png:File|Managers/Z_ICONS.PNG:$(PROGS)/fs/opendial/z_icons.png \
  232.  File|Managers/kfm_keys.txt:File|Managers/KFM_KEYS.TXT:$(PROGS)/fs/kfm/trunk/docs/english/kfm_keys.txt \
  233.  File|Managers/buttons.bmp:File|Managers/BUTTONS.BMP:$(PROGS)/fs/kfm/trunk/buttons.bmp \
  234.  File|Managers/icons.bmp:File|Managers/ICONS.BMP:$(PROGS)/fs/kfm/trunk/icons.bmp \
  235.  fonts/litt.chr:FONTS/LITT.CHR:$(PROGS)/demos/bgitest/trunk/FONTS/LITT.CHR \
  236.  games/snake.ini:GAMES/SNAKE.INI:$(PROGS)/games/snake/trunk/snake.ini \
  237.  games/skin.raw:GAMES/SKIN.RAW:$(PROGS)/games/soko/trunk/SKIN.RAW \
  238.  games/soko-4.lev:GAMES/SOKO-4.LEV:$(PROGS)/games/soko/trunk/SOKO-4.LEV \
  239.  games/soko-5.lev:GAMES/SOKO-5.LEV:$(PROGS)/games/soko/trunk/SOKO-5.LEV \
  240.  games/soko-6.lev:GAMES/SOKO-6.LEV:$(PROGS)/games/soko/trunk/SOKO-6.LEV \
  241.  games/soko-7.lev:GAMES/SOKO-7.LEV:$(PROGS)/games/soko/trunk/SOKO-7.LEV \
  242.  games/soko-8.lev:GAMES/SOKO-8.LEV:$(PROGS)/games/soko/trunk/SOKO-8.LEV \
  243.  games/soko-9.lev:GAMES/SOKO-9.LEV:$(PROGS)/games/soko/trunk/SOKO-9.LEV \
  244.  media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \
  245.  .shell:.shell:$(PROGS)/system/shell/bin/eng/.shell \
  246.  mykey.ini:MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \
  247. # end of list
  248.  
  249. # The list of all C-- programs with one main C-- file.
  250. # Format of an item is exactly the same as in the previous list,
  251. # except that there can be fourth field with parameters for a compiler.
  252. CMM_PROGRAMS:=\
  253.  File|Managers/Eolite:File|Managers/EOLITE:$(PROGS)/fs/Eolite/trunk/Eolite.c-- \
  254.  games/clicks:GAMES/CLICKS:$(PROGS)/games/clicks/trunk/clicks.c-- \
  255.  games/FindNumbers:GAMES/FindNumbers:$(PROGS)/games/FindNumbers/trunk/FindNumbers.c-- \
  256.  games/flood-it:GAMES/flood-it:$(PROGS)/games/flood-it/trunk/flood-it.c \
  257.  games/mine:GAMES/MINE:$(PROGS)/games/mine/trunk/mine.c--:/MEOS \
  258.  HTMLv:HTMLv:$(PROGS)/network/htmlv/browser/HTMLv.c-- \
  259. #develop/c--:DEVELOP/C--:$(PROGS)/develop/c--/trunk/32.c-- \
  260. # end of list
  261.  
  262. # List of other files to be included in the image file.
  263. # Some of them are auto-built with special rules, some just exist before build.
  264. # Each item is of the form <local name>:<name inside image>.
  265. # Spaces should be represented as |.
  266. OTHER_FILES:=autorun.dat:AUTORUN.DAT \
  267.  background.gif:background.gif default.skn:DEFAULT.SKN \
  268.  e80:E80 graph:GRAPH hdread:HDREAD \
  269.  icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
  270.  kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
  271.  kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \
  272.  menu.dat:MENU.DAT \
  273.  panel.ini:PANEL.INI setup.dat:SETUP.DAT \
  274.  shell:SHELL table:TABLE \
  275.  vmode:VMODE 3d/3dsheart:3D/3DSHEART \
  276.  3d/cubeline:3D/CUBELINE 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
  277.  demos/ak47.lif:DEMOS/AK47.LIF \
  278.  demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
  279.  demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
  280.  demos/use_mb:DEMOS/USE_MB \
  281.  File|Managers/eolite.ini:File|Managers/EOLITE.INI \
  282.  File|Managers/icons.ini:File|Managers/ICONS.INI \
  283.  File|Managers/kfar.ini:File|Managers/KFAR.INI \
  284.  File|Managers/kfm.ini:File|Managers/KFM.INI \
  285.  games/checkers:GAMES/CHECKERS \
  286.  games/kosilka:GAMES/KOSILKA games/kosskin.gfx:GAMES/KOSSKIN.GFX \
  287.  games/reversi:GAMES/REVERSI games/rforces:GAMES/RFORCES \
  288.  games/xonix:GAMES/XONIX games/megamaze:GAMES/MEGAMAZE \
  289.  lib/msgbox.obj:LIB/MSGBOX.OBJ \
  290.  lib/pixlib.obj:LIB/PIXLIB.OBJ lib/sort.obj:LIB/SORT.OBJ \
  291.  drivers/intel_hda.obj:DRIVERS/intel_hda.obj \
  292.  media/ac97snd:MEDIA/AC97SND \
  293.  network/jmail:NETWORK/JMAIL network/zeroconf.ini:NETWORK/ZEROCONF.INI \
  294. #end of list
  295. #3d/logio.bmp:3D/LOGIO.BMP 3d/cubetext:3D/CUBETEXT
  296.  
  297. # Generate skins list understandable by gnu make
  298. Makefile.skins: $(REPOSITORY)/skins/authors.txt $(REPOSITORY)/data/generate_makefile_skins.sh
  299.         cut -f1 $< | $(SHELL) $(REPOSITORY)/data/generate_makefile_skins.sh > $@
  300. include Makefile.skins
  301.  
  302. # Extra targets for LiveCD image in the syntax of mkisofs
  303. MKISOFS_EXTRA:=\
  304.  dosbox/=$(PROGS)/emulator/DosBox/dosbox \
  305.  dosbox/=$(PROGS)/emulator/DosBox/dosbox.conf \
  306.  dosbox/=$(PROGS)/emulator/DosBox/readme.txt \
  307.  /=drivers/atikms \
  308.  /=drivers/atikms.dll \
  309.  /=distr_data/autorun.inf \
  310.  /=distr_data/KolibriOS_icon.ico \
  311.  /=distr_data/readme.txt \
  312.  Skins/=$(REPOSITORY)/skins/authors.txt \
  313.  Docs/config.txt=docs/CONFIG.TXT \
  314.  Docs/copying.txt=docs/COPYING.TXT \
  315.  Docs/hot_keys.txt=docs/HOT_KEYS.TXT \
  316.  Docs/install.txt=docs/INSTALL.TXT \
  317.  Docs/readme.txt=docs/README.TXT \
  318.  Docs/stack.txt=docs/STACK.TXT \
  319.  Docs/sysfuncs.txt=docs/SYSFUNCS.TXT \
  320.  HD_Load/9x2klbr/=distr_data/9x2klbr.exe \
  321.  HD_Load/9x2klbr/=../common/HD_load/9x2klbr/LDKLBR.VXD \
  322.  HD_Load/9x2klbr/=$(PROGS)/hd_load/9x2klbr/readme.txt \
  323.  HD_Load/MeOSLoad/=distr_data/MeOSload.com \
  324.  HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/AUTOEXEC.BAT \
  325.  HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/CONFIG.SYS \
  326.  HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/L_readme.txt \
  327.  HD_Load/MeOSLoad/=$(PROGS)/hd_load/meosload/L_readme_Win.txt \
  328.  HD_Load/mtldr/=distr_data/mtldr \
  329.  HD_Load/mtldr/install.txt=$(PROGS)/hd_load/mtldr/install_eng.txt \
  330.  HD_Load/mtldr/=$(PROGS)/hd_load/mtldr/vista_install.bat \
  331.  HD_Load/mtldr/=$(PROGS)/hd_load/mtldr/vista_remove.bat \
  332.  HD_Load/=distr_data/mtldr_install.exe \
  333.  HD_Load/memdisk=../common/HD_load/memdisk \
  334.  HD_Load/USB_Boot/=distr_data/BOOT_F32.BIN \
  335.  HD_Load/USB_Boot/=distr_data/MTLD_F32 \
  336.  HD_Load/USB_Boot/=distr_data/inst.exe \
  337.  HD_Load/USB_Boot/=distr_data/setmbr.exe \
  338.  HD_Load/USB_Boot/readme.txt=$(PROGS)/hd_load/usb_boot/readme_eng.txt \
  339.  HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot.rtf \
  340.  HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot_866.txt \
  341.  HD_Load/USB_boot_old/=$(PROGS)/hd_load/usb_boot_old/usb_boot_1251.txt \
  342.  HD_Load/USB_boot_old/MeOSload.com=distr_data/MeOSload_for_usb_boot_old.com \
  343.  HD_Load/USB_boot_old/enable.exe=distr_data/enable_for_usb_boot_old.exe \
  344.  games/=../common/games \
  345.  games/fara=games/fara \
  346.  games/soko/soko=games/soko \
  347. #end of list
  348.  
  349. # Some macro for convenient work.
  350. # Macros for replacing '|' to escaped space '\ '.
  351. space:=\ #plus space
  352. respace=$(subst |,$(space),$(1))
  353. # Macro for selecting different parts of ':'-separated items.
  354. binarypart=$(word 1,$(subst :, ,$(1)))
  355. imagepart=$(word 2,$(subst :, ,$(1)))
  356. sourcepart=$(word 3,$(subst :, ,$(1)))
  357. parampart=$(word 4,$(subst :, ,$(1)))
  358. # Get file names, possibly with spaces inside, from an item.
  359. # Here $(f) is an item - in fact, macro argument.
  360. fbinary=$(call respace,$(call binarypart,$(f)))
  361. fimage=$(call respace,$(call imagepart,$(f)))
  362. fsource=$(call respace,$(call sourcepart,$(f)))
  363. fparam=$(call respace,$(call parampart,$(f)))
  364.  
  365. # Define targets for image file.
  366. # Join all the lists above.
  367. targets_full:=$(COPY_FILES) $(FASM_PROGRAMS) $(NASM_PROGRAMS) $(OTHER_FILES) $(CMM_PROGRAMS)
  368. # For each item in the united list call fbinary.
  369. targets:=$(foreach f,$(targets_full),$(fbinary))
  370.  
  371. # Define a command for copying a file inside the image.
  372. # mcopy_command is a macro with two parameters,
  373. # local file name $(1) and image file name $(2).
  374. # Note that spaces in these have to be escaped with backslashes.
  375. mcopy_command=mcopy -moi $(BUILD_DIR)/kolibri.img $(1) ::$(2)
  376. # Specialize a previous command for an item $(f) in one of lists.
  377. mcopy_item_command=$(call mcopy_command,$(fbinary),$(fimage))
  378.  
  379. # Join all $(mcopy_item_command) for all items,
  380. # append newline after each item.
  381. # The first newline character after "define" line and
  382. # the last newline character before "endef" line get away
  383. # with define/endef, so we make three newline characters,
  384. # that is two empty lines, in order to get one in $(newline).
  385. define newline
  386.  
  387.  
  388. endef
  389. mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
  390.  
  391. # add skins to MKISOFS_EXTRA
  392. MKISOFS_EXTRA:=$(MKISOFS_EXTRA) $(foreach f,$(SKIN_SOURCES),$(call imagepart,$(f))=$(call binarypart,$(f)))
  393. # dependencies of MKISOFS_EXTRA; we iterate through $(MKISOFS_EXTRA),
  394. # substitute "=" with space, get the 2nd word and join all results
  395. mkisofs_extra_targets:=$(call respace,$(foreach f,$(MKISOFS_EXTRA),$(word 2,$(subst =, ,$(f)))))
  396.  
  397. # The first goal: floppy image.
  398. $(BUILD_DIR)/kolibri.img: $(BUILD_DIR)/.dir \
  399.  Makefile \
  400.  $(BUILD_DIR)/boot_fat12.bin \
  401.  $(targets)
  402. # SYSXTREE
  403. # 3d/CUBETEXT
  404. # 3d/LOGIO.BMP
  405.         str=`date -u +"[auto-build %d %b %Y %R, r$(REV)]"`; \
  406.         echo -n $$str|dd of=kernel.mnt bs=1 seek=`expr 279 - length "$$str"` conv=notrunc 2>/dev/null
  407.         dd if=/dev/zero of=$(BUILD_DIR)/kolibri.img count=2880 bs=512 2>&1
  408.         mformat -f 1440 -i $(BUILD_DIR)/kolibri.img ::
  409.         dd if=$(BUILD_DIR)/boot_fat12.bin of=$(BUILD_DIR)/kolibri.img count=1 bs=512 conv=notrunc 2>&1
  410.         mmd -i $(BUILD_DIR)/kolibri.img ::3D
  411.         mmd -i $(BUILD_DIR)/kolibri.img ::DEMOS
  412.         mmd -i $(BUILD_DIR)/kolibri.img ::DEVELOP
  413.         mmd -i $(BUILD_DIR)/kolibri.img ::DEVELOP/INFO
  414.         mmd -i $(BUILD_DIR)/kolibri.img ::DRIVERS
  415.         mmd -i $(BUILD_DIR)/kolibri.img ::File\ Managers
  416.         mmd -i $(BUILD_DIR)/kolibri.img ::FONTS
  417.         mmd -i $(BUILD_DIR)/kolibri.img ::GAMES
  418.         mmd -i $(BUILD_DIR)/kolibri.img ::LIB
  419.         mmd -i $(BUILD_DIR)/kolibri.img ::MEDIA
  420.         mmd -i $(BUILD_DIR)/kolibri.img ::NETWORK
  421.         $(mcopy_all_items)
  422.  
  423. # The second goal: LiveCD image.
  424. $(BUILD_DIR)/kolibri.iso: $(BUILD_DIR)/kolibri.img $(mkisofs_extra_targets)
  425.         mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -graft-points \
  426.         -A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "KolibriOS r$(REV)" -sysid "KOLIBRI" \
  427.         -iso-level 3 -o $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/kolibri.img $(call respace,$(MKISOFS_EXTRA)) 2>&1
  428.  
  429. # Special targets to modify behaviour of make.
  430. .DELETE_ON_ERROR:
  431. .SUFFIXES: # delete all predefined rules
  432.  
  433. # The floppy bootsector.
  434. $(BUILD_DIR)/boot_fat12.bin: $(KERNEL)/bootloader/boot_fat12.asm $(KERNEL)/bootloader/floppy1440.inc
  435.         fasm $(KERNEL)/bootloader/boot_fat12.asm $(BUILD_DIR)/boot_fat12.bin
  436.  
  437. $(BUILD_DIR)/.dir 3d/.dir demos/.dir develop/.dir develop/info/.dir drivers/.dir fonts/.dir \
  438.  games/.dir lib/.dir media/.dir network/.dir allskins/.dir distr_data/.dir .deps/.dir:
  439.         mkdir -p $(dir $@)
  440.         touch $@
  441. develop/info/.dir: develop/.dir
  442. File\ Managers/.dir:
  443.         mkdir -p "File Managers"
  444.         touch "File Managers/.dir"
  445.  
  446. # FASM black magic goes to Makefile.fasm.
  447. include Makefile.fasm
  448.  
  449. # Similar for NASM.
  450. include Makefile.nasm
  451.  
  452. # Similar for copying files.
  453. include Makefile.copy
  454.  
  455. # Special rules for copying sysfuncs.txt - it isn't directly included in the image.
  456. docpack: $(DOCDIR)SYSFUNCS.TXT $(wildcard $(DOCDIR)*)
  457. $(DOCDIR)SYSFUNCS.TXT: $(KERNEL)/docs/sysfuncs.txt
  458.         cp $(KERNEL)/docs/sysfuncs.txt $(DOCDIR)SYSFUNCS.TXT
  459.  
  460. # Similar for C--.
  461. include Makefile.cmm
  462.  
  463. # Sorry, even black magic seems to be insufficient for
  464. # auto-handling all subtle effects. So we just define
  465. # command lines for compiling and linking, and
  466. # maintain the list of sources and objects by hand.
  467. include Makefile.msvc
  468.  
  469. # Rules for table
  470. table: .obj.table/table.exe
  471.         $(msvc_final)
  472. TABLE_OBJECTS:=.obj.table/calc.obj .obj.table/func.obj .obj.table/hello.obj \
  473.  .obj.table/KosFile.obj .obj.table/kosSyst.obj .obj.table/math2.obj \
  474.  .obj.table/mcsmemm.obj .obj.table/parser.obj
  475. TABLE_H_FILES:=$(wildcard $(PROGS)/other/table/*.h)
  476. .obj.table/table.exe: $(TABLE_OBJECTS)
  477.         $(msvc_link)
  478. $(TABLE_OBJECTS): .obj.table/%.obj: $(PROGS)/other/table/%.cpp $(TABLE_H_FILES) Makefile.msvc | .obj.table
  479.         $(msvc_compile)
  480. .obj.table:
  481.         mkdir -p .obj.table
  482.  
  483. # Rules for graph
  484. graph: .obj.graph/graph.exe
  485.         $(msvc_final)
  486. GRAPH_CPP_OBJECTS:=.obj.graph/func.obj .obj.graph/hello.obj .obj.graph/kolibri.obj \
  487.  .obj.graph/KosFile.obj .obj.graph/kosSyst.obj .obj.graph/math2.obj \
  488.  .obj.graph/mcsmemm.obj .obj.graph/parser.obj
  489. GRAPH_C_OBJECTS:=.obj.graph/string.obj
  490. GRAPH_H_FILES:=$(wildcard $(PROGS)/other/graph/*.h)
  491. GRAPH_FASM_OBJECTS:=.obj.graph/memcpy.obj .obj.graph/memset.obj
  492. .obj.graph/graph.exe: $(GRAPH_CPP_OBJECTS) $(GRAPH_C_OBJECTS) $(GRAPH_FASM_OBJECTS)
  493.         $(msvc_link)
  494. $(GRAPH_CPP_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.cpp $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
  495.         $(msvc_compile)
  496. $(GRAPH_C_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.c $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
  497.         $(msvc_compile)
  498. $(GRAPH_FASM_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.asm Makefile.msvc | .obj.graph
  499.         fasm $< $@
  500. .obj.graph:
  501.         mkdir -p .obj.graph
  502.  
  503. # Rules for kosilka
  504. games/kosilka: .obj.kosilka/kosilka.exe
  505.         $(msvc_final)
  506. KOSILKA_OBJECTS:=.obj.kosilka/kosilka.obj .obj.kosilka/KosFile.obj .obj.kosilka/kosSyst.obj .obj.kosilka/mcsmemm.obj
  507. KOSILKA_H_FILES:=$(PROGS)/games/kosilka/*.h
  508. .obj.kosilka/kosilka.exe: $(KOSILKA_OBJECTS)
  509.         $(msvc_link)
  510. $(KOSILKA_OBJECTS): .obj.kosilka/%.obj: $(PROGS)/games/kosilka/%.cpp $(KOSILKA_H_FILES) Makefile.msvc | .obj.kosilka
  511.         $(msvc_compile)
  512. .obj.kosilka:
  513.         mkdir -p .obj.kosilka
  514.  
  515. include Makefile.gcc
  516.  
  517. # Rules for shell
  518. 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 \
  519.  $(PROGS)/system/shell/kolibri.ld
  520.         $(call gcc_link,$(PROGS)/system/shell/kolibri.ld)
  521. .obj.shell/shell.o: $(PROGS)/system/shell/shell.c \
  522.  $(PROGS)/system/shell/all.h \
  523.  $(PROGS)/system/shell/system/*.h \
  524.  $(PROGS)/system/shell/cmd/*.c \
  525.  $(PROGS)/system/shell/modules/*.c \
  526.  $(PROGS)/system/shell/locale/rus/globals.h \
  527.  Makefile.gcc | .obj.shell
  528.         $(gcc_compile)
  529. .obj.shell/kolibri.o .obj.shell/stdlib.o .obj.shell/string.o .obj.shell/ctype.o: .obj.shell/%.o: \
  530.  $(PROGS)/system/shell/system/%.c $(PROGS)/system/shell/system/*.h \
  531.  Makefile.gcc | .obj.shell
  532.         $(gcc_compile)
  533.         win32-gcc -c -Os -o $@ $<
  534. .obj.shell/start.o: $(PROGS)/system/shell/start.asm | .obj.shell
  535.         fasm $< $@
  536. .obj.shell:
  537.         mkdir -p .obj.shell
  538.  
  539. # Rules for e80
  540. E80DIR=$(PROGS)/emulator/e80/trunk
  541. 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
  542.         $(call gcc_link,$(E80DIR)/kolibri.ld)
  543. .obj.e80/e80.o: $(E80DIR)/e80.c $(E80DIR)/48.h \
  544.  $(E80DIR)/system/*.h $(E80DIR)/system/msgbox.c \
  545.  $(E80DIR)/z80/z80.h Makefile.gcc | .obj.e80
  546.         $(gcc_compile)
  547. .obj.e80/kolibri.o .obj.e80/stdlib.o .obj.e80/string.o: .obj.e80/%.o: \
  548.  $(E80DIR)/system/%.c $(E80DIR)/system/*.h Makefile.gcc | .obj.e80
  549.         $(gcc_compile)
  550. .obj.e80/z80.o: $(E80DIR)/z80/z80.c $(E80DIR)/z80/*
  551.         $(gcc_compile)
  552. .obj.e80/start.o: $(E80DIR)/asm_code.asm | .obj.e80
  553.         fasm $< $@
  554. .obj.e80:
  555.         mkdir -p .obj.e80
  556.  
  557. # Rules for sdk/sound, used by media/ac97snd
  558. SOUNDDIR=$(PROGS)/develop/sdk/trunk/sound/src
  559. SOUND_OBJECTS:=$(patsubst $(SOUNDDIR)/%.asm,.sdk/%.obj,$(wildcard $(SOUNDDIR)/*.asm))
  560. SOUND_INC_FILES:=$(wildcard $(SOUNDDIR)/*.inc)
  561. .sdk/sound.lib: $(SOUND_OBJECTS)
  562.         win32-link /lib /out:$@ $^
  563. $(SOUND_OBJECTS): .sdk/%.obj: $(SOUNDDIR)/%.asm $(SOUND_INC_FILES) | .sdk
  564.         fasm $< $@
  565. .sdk:
  566.         mkdir -p .sdk
  567. # Rules for media/ac97snd
  568. AC97DIR=$(PROGS)/media/ac97snd
  569. media/ac97snd: .obj.ac97snd/ac97snd.exe
  570.         $(msvc_final)
  571. .obj.ac97snd/ac97snd.exe: .obj.ac97snd/ac97wav.obj .obj.ac97snd/crt.obj .obj.ac97snd/k_lib.obj \
  572.         .obj.ac97snd/mpg.lib .sdk/sound.lib .obj.ac97snd/ufmod.obj
  573.         $(msvc_link)
  574. .obj.ac97snd/ac97wav.obj: $(AC97DIR)/ac97snd/ac97wav.c \
  575.         $(AC97DIR)/kolibri.h $(AC97DIR)/ac97snd/ac97wav.h $(AC97DIR)/mpg/mpg123.h \
  576.         $(AC97DIR)/sound.h $(AC97DIR)/ufmod-codec.h Makefile.msvc | .obj.ac97snd
  577.         $(msvc_compile)
  578. .obj.ac97snd/crt.obj: $(AC97DIR)/ac97snd/crt.c $(AC97DIR)/ac97snd/crt.h Makefile.msvc | .obj.ac97snd
  579.         $(msvc_compile)
  580. .obj.ac97snd/k_lib.obj: $(AC97DIR)/ac97snd/k_lib.asm $(AC97DIR)/ac97snd/proc32.inc | .obj.ac97snd
  581.         fasm $< $@
  582. .obj.ac97snd/ufmod.obj: $(AC97DIR)/ufmod-config.asm | .obj.ac97snd
  583.         fasm $< $@ -s .deps/ac97snd-ufmod.fas
  584.         prepsrc .deps/ac97snd-ufmod.fas /dev/stdout | \
  585.         perl -n -e 's|\\|/|g;s| |\\ |g;push @a,$$1 if/^;include\\ \x27(.*?)\x27/;' \
  586.         -e 'END{$$a=join " \\\n ",@a;print "$@: $$a\n$$a:\n"}' > .deps/ac97snd-ufmod.Po
  587. -include .deps/ac97snd-ufmod.Po
  588. AC97SND_MPG_C_FILES:=$(wildcard $(AC97DIR)/mpg/*.c)
  589. AC97SND_MPG_H_FILES:=$(wildcard $(AC97DIR)/mpg/*.h)
  590. AC97SND_MPG_C_OBJECTS:=$(patsubst $(AC97DIR)/mpg/%.c,.obj.ac97snd/%.o,$(AC97SND_MPG_C_FILES))
  591. .obj.ac97snd/mpg.lib: $(AC97SND_MPG_C_OBJECTS) .obj.ac97snd/pow.obj
  592.         win32-link /lib /ltcg /out:$@ $^
  593. $(AC97SND_MPG_C_OBJECTS): .obj.ac97snd/%.o: $(AC97DIR)/mpg/%.c $(AC97SND_MPG_H_FILES) Makefile.msvc | .obj.ac97snd
  594.         $(msvc_compile)
  595. .obj.ac97snd/pow.obj: $(AC97DIR)/mpg/pow.asm $(AC97DIR)/mpg/proc32.inc | .obj.ac97snd
  596.         fasm $< $@
  597. .obj.ac97snd:
  598.         mkdir -p .obj.ac97snd
  599.  
  600. # Rules for atikms.dll
  601. # Use Makefile from $(REPOSITORY)/drivers/ddk and $(REPOSITORY)/drivers/video/drm/radeon
  602. # However, dependencies must be duplicated - I don't know how to avoid this
  603. # without need to rebuild kolibri.img at every iteration...
  604. # Note that we are going to write in the directory shared
  605. # between all Makefiles, so we need locked operations.
  606. drivers/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll drivers/.dir
  607.         kpack --nologo $< $@
  608. $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/Makefile.lto
  609.         flock $(REPOSITORY)/drivers/video/drm/radeon/.lock \
  610.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/video/drm/radeon -f Makefile.lto
  611. $(REPOSITORY)/drivers/ddk/libddk.a: $(REPOSITORY)/drivers/ddk/Makefile
  612.         flock $(REPOSITORY)/drivers/ddk/.lock \
  613.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libddk.a
  614. $(REPOSITORY)/drivers/ddk/libcore.a: $(REPOSITORY)/drivers/ddk/Makefile
  615.         flock $(REPOSITORY)/drivers/ddk/.lock \
  616.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libcore.a
  617. # dependencies
  618. $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: \
  619.  $(REPOSITORY)/drivers/video/drm/radeon/atikms.lds \
  620.  $(REPOSITORY)/drivers/ddk/libddk.a \
  621.  $(REPOSITORY)/drivers/ddk/libcore.a \
  622.  $(REPOSITORY)/drivers/video/drm/radeon/*.[Sch] \
  623.  $(REPOSITORY)/drivers/video/drm/radeon/*.asm \
  624.  $(REPOSITORY)/drivers/video/drm/radeon/Makefile \
  625.  $(REPOSITORY)/drivers/video/drm/radeon/firmware/*.bin \
  626.  $(REPOSITORY)/drivers/include/*.h \
  627.  $(REPOSITORY)/drivers/include/*/*.h \
  628.  $(REPOSITORY)/drivers/include/*/*/*.h \
  629.  $(REPOSITORY)/drivers/include/*/*/*/*.h
  630. $(REPOSITORY)/drivers/ddk/libddk.a: \
  631.  $(REPOSITORY)/drivers/ddk/*/* \
  632.  $(REPOSITORY)/drivers/include/*.h \
  633.  $(REPOSITORY)/drivers/include/*/*.h \
  634.  $(REPOSITORY)/drivers/include/*/*/*.h \
  635.  $(REPOSITORY)/drivers/include/*/*/*/*.h
  636. $(REPOSITORY)/drivers/ddk/libcore.a: \
  637.  $(REPOSITORY)/drivers/ddk/core.S
  638.