Subversion Repositories Kolibri OS

Rev

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