Subversion Repositories Kolibri OS

Rev

Rev 2721 | Blame | 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. # Docpak requires some documents; we place them
  13. # into 'docs' subdir and communicate with FASM
  14. # through environment var DOCDIR.
  15. DOCDIR:=docs/
  16. export DOCDIR
  17.  
  18. # Because most programs are written in FASM and have
  19. # the common structure of one main .asm file possibly including
  20. # several .inc files, we handle this case separately.
  21. # Namely, we organize one big list of such programs
  22. # (FASM_PROGRAMS, see below) containing name of local binary file,
  23. # name of file inside kolibri.img and name of the source file.
  24. # This list is maintained by hand, and the rest is done with some macroses...
  25. # well, slightly complicated macroses - however, you do not need to
  26. # understand them in order to maintain the list.
  27. # To add a FASM program with one .asm file, just
  28. # add the corresponding item to the list and enjoy
  29. # the power of GNU make.
  30.  
  31. # The list of all FASM programs with one main FASM file.
  32. # Every item consists of three parts, separated by ':'.
  33. # First part is the real name of binary file in $(BUILD_DIR)
  34. # as it should be produced by make.
  35. # Second part is the name of a file inside kolibri.img,
  36. # usually uppercased version of first part - to save space
  37. # for FAT filesystem.
  38. # Third part is the name of the source file.
  39. # Spaces separate items, so spaces in names should be
  40. # represented as '|'.
  41. FASM_PROGRAMS:=\
  42.  @clip:@CLIP:$(PROGS)/system/clip/trunk/@clip.ASM \
  43.  @menu:@MENU:$(PROGS)/system/menu/trunk/menu.asm \
  44.  @notify:@NOTIFY:$(PROGS)/system/notify/trunk/@notify.asm \
  45.  @panel:@PANEL:$(PROGS)/system/panel/trunk/@PANEL.ASM \
  46.  @rb:@RB:$(PROGS)/system/rb/trunk/@RB.ASM \
  47.  @ss:@SS:$(PROGS)/system/ss/trunk/@ss.asm \
  48.  refrscrn:REFRSCRN:$(PROGS)/system/refrscrn/refrscrn.asm \
  49.  asciivju:ASCIIVJU:$(PROGS)/develop/asciivju/trunk/asciivju.asm \
  50.  calc:CALC:$(PROGS)/other/calc/trunk/calc.asm \
  51.  calendar:CALENDAR:$(PROGS)/system/calendar/trunk/calendar.asm \
  52.  commouse:COMMOUSE:$(PROGS)/system/commouse/trunk/commouse.asm \
  53.  cpu:CPU:$(PROGS)/system/cpu/trunk/cpu.asm \
  54.  cpuid:CPUID:$(PROGS)/system/cpuid/trunk/CPUID.ASM \
  55.  desktop:DESKTOP:$(PROGS)/system/desktop/trunk/desktop.asm \
  56.  disptest:DISPTEST:$(PROGS)/system/disptest/trunk/disptest.ASM \
  57.  docpak:DOCPAK:$(PROGS)/system/docpack/trunk/docpack.asm \
  58.  end:END:$(PROGS)/system/end/light/end.asm \
  59.  gmon:GMON:$(PROGS)/system/gmon/gmon.asm \
  60.  hdd_info:HDD_INFO:$(PROGS)/system/hdd_info/trunk/hdd_info.asm \
  61.  icon:ICON:$(PROGS)/system/icon/trunk/icon.asm \
  62.  cropflat:CROPFLAT:$(PROGS)/system/cropflat/cropflat.asm \
  63.  kbd:KBD:$(PROGS)/system/kbd/trunk/kbd.ASM \
  64.  kpack:KPACK:$(PROGS)/other/kpack/trunk/kpack.asm \
  65.  launcher:LAUNCHER:$(PROGS)/system/launcher/trunk/launcher.asm \
  66.  magnify:MAGNIFY:$(PROGS)/demos/magnify/trunk/magnify.asm \
  67.  mgb:MGB:$(PROGS)/system/mgb/trunk/mgb.asm \
  68.  mousemul:MOUSEMUL:$(PROGS)/system/mousemul/trunk/mousemul.asm \
  69.  mykey:MYKEY:$(PROGS)/system/MyKey/trunk/MyKey.asm \
  70.  pcidev:PCIDEV:$(PROGS)/system/pcidev/trunk/PCIDEV.ASM \
  71.  period:PERIOD:$(PROGS)/other/period/trunk/period.asm \
  72.  pic4:PIC4:$(PROGS)/media/pic4/trunk/pic4.asm \
  73.  rdsave:RDSAVE:$(PROGS)/system/rdsave/trunk/rdsave.asm \
  74.  rtfread:RTFREAD:$(PROGS)/other/rtfread/trunk/rtfread.asm \
  75.  run:RUN:$(PROGS)/system/run/trunk/run.asm \
  76.  scrshoot:SCRSHOOT:$(PROGS)/media/scrshoot/scrshoot.asm \
  77.  setup:SETUP:$(PROGS)/system/setup/trunk/setup.asm \
  78.  test:TEST:$(PROGS)/system/test/trunk/test.asm \
  79.  tinypad:TINYPAD:$(PROGS)/develop/tinypad/trunk/tinypad.asm \
  80.  t_edit:T_EDIT:$(PROGS)/other/t_edit/t_edit.asm \
  81.  zkey:ZKEY:$(PROGS)/system/zkey/trunk/ZKEY.ASM \
  82.  3d/3dcube2:3D/3DCUBE2:$(PROGS)/demos/3dcube2/trunk/3DCUBE2.ASM \
  83.  3d/3dsheart:3D/3DSHEART:$(PROGS)/demos/3dsheart/trunk/3dsheart.asm \
  84.  3d/3dwav:3D/3DWAV:$(PROGS)/demos/3dwav/trunk/3dwav.asm \
  85.  3d/crownscr:3D/CROWNSCR:$(PROGS)/demos/crownscr/trunk/crownscr.asm  \
  86.  3d/flatwav:3D/FLATWAV:$(PROGS)/demos/flatwav/trunk/FLATWAV.ASM \
  87.  3d/free3d04:3D/FREE3D04:$(PROGS)/demos/free3d04/trunk/free3d04.asm \
  88.  3d/view3ds:3D/VIEW3DS:$(PROGS)/demos/3DS/VIEW3DS.ASM \
  89.  demos/bcdclk:DEMOS/BCDCLK:$(PROGS)/demos/bcdclk/trunk/bcdclk.asm \
  90.  demos/circle:DEMOS/CIRCLE:$(PROGS)/develop/examples/circle/trunk/circle.asm \
  91.  demos/colorref:DEMOS/COLORREF:$(PROGS)/demos/colorref/trunk/colorref.asm \
  92.  demos/cslide:DEMOS/CSLIDE:$(PROGS)/demos/cslide/trunk/cslide.asm \
  93.  demos/eyes:DEMOS/EYES:$(PROGS)/demos/eyes/trunk/eyes.asm \
  94.  demos/fire:DEMOS/FIRE:$(PROGS)/demos/fire/trunk/fire.asm \
  95.  demos/firework:DEMOS/FIREWORK:$(PROGS)/demos/firework/trunk/firework.asm \
  96.  demos/movback:DEMOS/MOVBACK:$(PROGS)/demos/movback/trunk/movback.asm \
  97.  demos/plasma:DEMOS/PLASMA:$(PROGS)/demos/plasma/trunk/plasma.asm \
  98.  demos/timer:DEMOS/TIMER:$(PROGS)/demos/timer/trunk/timer.asm \
  99.  demos/tinyfrac:DEMOS/TINYFRAC:$(PROGS)/demos/tinyfrac/trunk/tinyfrac.asm \
  100.  demos/trantest:DEMOS/TRANTEST:$(PROGS)/demos/trantest/trunk/trantest.asm \
  101.  demos/tube:DEMOS/TUBE:$(PROGS)/demos/tube/trunk/tube.asm \
  102.  demos/unvwater:DEMOS/UNVWATER:$(PROGS)/demos/unvwater/trunk/unvwater.asm \
  103.  demos/web:DEMOS/WEB:$(PROGS)/demos/web/trunk/web.asm \
  104.  develop/board:DEVELOP/BOARD:$(PROGS)/system/board/trunk/board.asm \
  105.  develop/cObj:DEVELOP/cObj:$(PROGS)/develop/cObj/trunk/cObj.asm \
  106.  develop/fasm:DEVELOP/FASM:$(PROGS)/develop/fasm/trunk/fasm.asm \
  107.  develop/h2d2b:DEVELOP/H2D2B:$(PROGS)/develop/h2d2b/trunk/h2d2b.asm \
  108.  develop/heed:DEVELOP/HEED:$(PROGS)/develop/heed/trunk/heed.asm \
  109.  develop/ipc:DEVELOP/IPC:$(PROGS)/network/ipc/trunk/ipc.asm \
  110.  develop/keyascii:DEVELOP/KEYASCII:$(PROGS)/develop/keyascii/trunk/keyascii.asm \
  111.  develop/mtdbg:DEVELOP/MTDBG:$(PROGS)/develop/mtdbg/mtdbg.asm \
  112.  develop/scancode:DEVELOP/SCANCODE:$(PROGS)/develop/scancode/trunk/scancode.asm \
  113.  develop/test_gets:DEVELOP/test_gets:$(PROGS)/develop/libraries/console/examples/test_gets.asm \
  114.  develop/testcon2:DEVELOP/TESTCON2:$(PROGS)/develop/libraries/console/examples/testcon2.asm \
  115.  develop/thread:DEVELOP/THREAD:$(PROGS)/develop/examples/thread/trunk/thread.asm \
  116.  drivers/com_mouse.obj:DRIVERS/COM_MOUSE.OBJ:$(KERNEL)/drivers/com_mouse.asm \
  117.  drivers/emu10k1x.obj:DRIVERS/EMU10K1X.OBJ:$(KERNEL)/drivers/emu10k1x.asm \
  118.  drivers/fm801.obj:DRIVERS/FM801.OBJ:$(KERNEL)/drivers/fm801.asm \
  119.  drivers/infinity.obj:DRIVERS/INFINITY.OBJ:$(KERNEL)/drivers/infinity.asm \
  120.  drivers/ps2mouse.obj:DRIVERS/PS2MOUSE.OBJ:$(REPOSITORY)/drivers/mouse/ps2mouse4d/trunk/ps2mouse.asm \
  121.  drivers/sb16.obj:DRIVERS/SB16.OBJ:$(KERNEL)/drivers/sb16/sb16.asm \
  122.  drivers/sound.obj:DRIVERS/SOUND.OBJ:$(KERNEL)/drivers/sound.asm \
  123.  drivers/vt8235.obj:DRIVERS/VT8235.OBJ:$(KERNEL)/drivers/vt823x.asm \
  124.  File|Managers/kfar:File|Managers/KFAR:$(PROGS)/fs/kfar/trunk/kfar.asm \
  125.  File|Managers/kfm:File|Managers/KFM:$(PROGS)/fs/kfm/trunk/kfm.asm \
  126.  File|Managers/opendial:File|Managers/OPENDIAL:$(PROGS)/fs/opendial/opendial.asm \
  127.  games/15:GAMES/15:$(PROGS)/games/15/trunk/15.ASM \
  128.  games/arcanii:GAMES/ARCANII:$(PROGS)/games/arcanii/trunk/arcanii.asm \
  129.  games/freecell:GAMES/FREECELL:$(PROGS)/games/freecell/freecell.asm \
  130.  games/gomoku:GAMES/GOMOKU:$(PROGS)/games/gomoku/trunk/gomoku.asm \
  131.  games/invaders:GAMES/INVADERS:$(PROGS)/games/invaders/invaders.asm \
  132.  games/klavisha:GAMES/KLAVISHA:$(PROGS)/games/klavisha/trunk/klavisha.asm \
  133.  games/kox:GAMES/KOX:$(PROGS)/games/kox/trunk/kox.asm \
  134.  games/lights:GAMES/LIGHTS:$(PROGS)/games/lights/trunk/lights.asm \
  135.  games/lines:GAMES/LINES:$(PROGS)/games/lines/lines.asm \
  136.  games/mblocks:GAMES/MBLOCKS:$(PROGS)/games/mblocks/trunk/mblocks.asm \
  137.  games/msquare:GAMES/MSQUARE:$(PROGS)/games/MSquare/trunk/MSquare.asm \
  138.  games/phenix:GAMES/PHENIX:$(PROGS)/games/phenix/trunk/phenix.asm \
  139.  games/pipes:GAMES/PIPES:$(PROGS)/games/pipes/pipes.asm \
  140.  games/pong:GAMES/PONG:$(PROGS)/games/pong/trunk/pong.asm \
  141.  games/pong3:GAMES/PONG3:$(PROGS)/games/pong3/trunk/pong3.asm \
  142.  games/rsquare:GAMES/RSQUARE:$(PROGS)/games/rsquare/trunk/rsquare.asm \
  143.  games/snake:GAMES/SNAKE:$(PROGS)/games/snake/trunk/snake.asm \
  144.  games/sq_game:GAMES/SQ_GAME:$(PROGS)/games/sq_game/trunk/SQ_GAME.ASM \
  145.  games/sudoku:GAMES/SUDOKU:$(PROGS)/games/sudoku/trunk/sudoku.asm \
  146.  games/sw:GAMES/SW:$(PROGS)/games/sw/trunk/sw.asm \
  147.  games/tanks:GAMES/TANKS:$(PROGS)/games/tanks/trunk/tanks.asm \
  148.  games/tetris:GAMES/TETRIS:$(PROGS)/games/tetris/trunk/tetris.asm \
  149.  info/asm.syn:INFO/ASM.SYN:$(PROGS)/other/t_edit/info/asm_syn.asm \
  150.  info/cpp_kol_cla.syn:INFO/CPP_KOL_CLA.SYN:$(PROGS)/other/t_edit/info/cpp_kol_cla_syn.asm \
  151.  info/cpp_kol_dar.syn:INFO/CPP_KOL_DAR.SYN:$(PROGS)/other/t_edit/info/cpp_kol_dar_syn.asm \
  152.  info/cpp_kol_def.syn:INFO/CPP_KOL_DEF.SYN:$(PROGS)/other/t_edit/info/cpp_kol_def_syn.asm \
  153.  info/default.syn:INFO/DEFAULT.SYN:$(PROGS)/other/t_edit/info/default_syn.asm \
  154.  info/html.syn:INFO/HTML.SYN:$(PROGS)/other/t_edit/info/html_syn.asm \
  155.  info/ini_files.syn:INFO/INI_FILES.SYN:$(PROGS)/other/t_edit/info/ini_files_syn.asm \
  156.  info/win_const.syn:INFO/WIN_CONST.SYN:$(PROGS)/other/t_edit/info/win_const_syn.asm \
  157.  lib/archiver.obj:LIB/ARCHIVER.OBJ:$(PROGS)/fs/kfar/trunk/kfar_arc/kfar_arc.asm \
  158.  lib/box_lib.obj:LIB/BOX_LIB.OBJ:$(PROGS)/develop/libraries/box_lib/trunk/box_lib.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/startmus:MEDIA/STARTMUS:$(PROGS)/media/startmus/trunk/STARTMUS.ASM \
  173.  network/airc:NETWORK/AIRC:$(PROGS)/network/airc/trunk/airc.asm \
  174.  network/arpstat:NETWORK/ARPSTAT:$(PROGS)/network/arpstat/trunk/arpstat.asm \
  175.  network/chess:NETWORK/CHESS:$(PROGS)/network/chess/trunk/chess.asm \
  176.  network/downloader:NETWORK/DOWNLOADER:$(PROGS)/network/downloader/trunk/downloader.asm \
  177.  network/ethstat:NETWORK/ETHSTAT:$(PROGS)/network/ethstat/trunk/ethstat.asm \
  178.  network/ftps:NETWORK/FTPS:$(PROGS)/network/ftps/trunk/FTPS.ASM \
  179.  network/https:NETWORK/HTTPS:$(PROGS)/network/https/trunk/https.asm \
  180.  network/nntpc:NETWORK/NNTPC:$(PROGS)/network/nntpc/trunk/nntpc.asm \
  181.  network/nslookup:NETWORK/NSLOOKUP:$(PROGS)/develop/libraries/network/examples/nslookup.asm \
  182.  network/popc:NETWORK/POPC:$(PROGS)/network/popc/trunk/popc.asm \
  183.  network/smtps:NETWORK/SMTPS:$(PROGS)/network/smtps/trunk/smtps.asm \
  184.  network/stackcfg:NETWORK/STACKCFG:$(PROGS)/network/stackcfg/trunk/stackcfg.asm \
  185.  network/telnet:NETWORK/TELNET:$(PROGS)/network/telnet/trunk/telnet.asm \
  186.  network/tftpc:NETWORK/TFTPC:$(PROGS)/network/tftpc/trunk/tftpc.asm \
  187.  network/VNCclient:NETWORK/VNCclient:$(PROGS)/network/VNCclient/VNCclient.asm \
  188.  network/ym:NETWORK/YM:$(PROGS)/network/ym/trunk/ym.asm \
  189.  network/zeroconf:NETWORK/ZEROCONF:$(PROGS)/network/zeroconf/trunk/zeroconf.asm \
  190. # end of list
  191. # The list of all FASM programs with one main FASM file for CD image.
  192. # Format of an item is exactly the same as in the previous list.
  193. FASM_PROGRAMS_CD:=\
  194.  drivers/atikms:DRIVERS/ATIKMS:$(REPOSITORY)/drivers/video/drm/radeon/atikms.asm \
  195. # end of list
  196.  
  197. # The list of all NASM programs with one main NASM file.
  198. # Format of an item is exactly the same as in the previous list.
  199. NASM_PROGRAMS:=\
  200.  demos/aclock:DEMOS/ACLOCK:$(PROGS)/demos/aclock/trunk/aclock.asm \
  201.  games/c4:GAMES/C4:$(PROGS)/games/c4/trunk/c4.asm \
  202. # end of list
  203.  
  204. # The list of files which should be copied from somewhere.
  205. # Format of an item is exactly the same as in the previous list.
  206. COPY_FILES:=\
  207.  macros.inc:MACROS.INC:$(PROGS)/macros.inc \
  208.  config.inc:CONFIG.INC:$(PROGS)/config.inc \
  209.  struct.inc:STRUCT.INC:$(PROGS)/struct.inc \
  210.  te_icon.png:TE_ICON.PNG:$(PROGS)/other/t_edit/te_icon.png \
  211.  tl_nod_16.png:TL_NOD_16.PNG:$(PROGS)/other/t_edit/tl_nod_16.png \
  212.  tl_sys_16.png:TL_SYS_16.PNG:$(PROGS)/media/log_el/trunk/tl_sys_16.png \
  213.  File|Managers/z_icons.png:File|Managers/Z_ICONS.PNG:$(PROGS)/fs/opendial/z_icons.png \
  214.  File|Managers/kfm_keys.txt:File|Managers/KFM_KEYS.TXT:$(PROGS)/fs/kfm/trunk/docs/russian/dos_kolibri/kfm_keys.txt \
  215.  File|Managers/buttons.bmp:File|Managers/BUTTONS.BMP:$(PROGS)/fs/kfm/trunk/buttons.bmp \
  216.  File|Managers/icons.bmp:File|Managers/ICONS.BMP:$(PROGS)/fs/kfm/trunk/icons.bmp \
  217.  fonts/litt.chr:FONTS/LITT.CHR:$(PROGS)/demos/bgitest/trunk/FONTS/LITT.CHR \
  218.  games/snake.ini:GAMES/SNAKE.INI:$(PROGS)/games/snake/trunk/snake.ini \
  219.  media/kiv.ini:MEDIA/KIV.INI:$(PROGS)/media/kiv/trunk/kiv.ini \
  220.  .shell:.shell:$(PROGS)/system/shell/bin/rus/.shell \
  221.  mykey.ini:MYKEY.INI:$(PROGS)/system/MyKey/trunk/mykey.ini \
  222. # end of list
  223.  
  224. # The list of all C-- programs with one main C-- file.
  225. # Format of an item is exactly the same as in the previous list,
  226. # except that there can be fourth field with parameters for a compiler.
  227. CMM_PROGRAMS:=\
  228.  File|Managers/eolite:File|Managers/EOLITE:$(PROGS)/fs/Eolite/trunk/Eolite.c-- \
  229.  games/clicks:GAMES/CLICKS:$(PROGS)/games/clicks/trunk/clicks.c-- \
  230.  games/FindNumbers:GAMES/FindNumbers:$(PROGS)/games/FindNumbers/trunk/FindNumbers.c-- \
  231.  games/flood-it:GAMES/flood-it:$(PROGS)/games/flood-it/trunk/flood-it.c \
  232.  games/mine:GAMES/MINE:$(PROGS)/games/mine/trunk/mine.c--:/MEOS \
  233.  HTMLv:HTMLv:$(PROGS)/network/htmlv/browser/HTMLv.c-- \
  234. # end of list
  235.  
  236. # List of other files to be included in the image file.
  237. # Some of them are auto-built with special rules, some just exist before build.
  238. # Each item is of the form <local name>:<name inside image>.
  239. # Spaces should be represented as |.
  240. #
  241. # yogev_ezra: Removed '3dsheart' to free some space on RAMDISK. This demo has 90% in common with VIEW3DS
  242. OTHER_FILES:=autorun.dat:AUTORUN.DAT \
  243.  background.gif:background.gif default.skn:DEFAULT.SKN \
  244.  e80:E80 graph:GRAPH hdread:HDREAD \
  245.  icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
  246.  kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
  247.  kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \
  248.  menu.dat:MENU.DAT \
  249.  panel.ini:PANEL.INI pipetka:PIPETKA setup.dat:SETUP.DAT \
  250.  shell:SHELL table:TABLE vmode:VMODE \
  251.  3d/cubeline:3D/CUBELINE 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \
  252.  demos/ak47.lif:DEMOS/AK47.LIF \
  253.  demos/barge.lif:DEMOS/BARGE.LIF demos/life2:DEMOS/LIFE2 \
  254.  demos/relay.lif:DEMOS/RELAY.LIF demos/rpento.lif:DEMOS/RPENTO.LIF \
  255.  demos/use_mb:DEMOS/USE_MB \
  256.  File|Managers/eolite.ini:File|Managers/EOLITE.INI \
  257.  File|Managers/icons.ini:File|Managers/ICONS.INI \
  258.  File|Managers/kfar.ini:File|Managers/KFAR.INI \
  259.  File|Managers/kfm.ini:File|Managers/KFM.INI \
  260.  games/appdata.dat:GAMES/APPDATA.DAT games/ataka:GAMES/ATAKA \
  261.  games/basekurs.kla:GAMES/BASEKURS.KLA games/checkers:GAMES/CHECKERS \
  262.  games/kosilka:GAMES/KOSILKA games/kosskin.gfx:GAMES/KOSSKIN.GFX \
  263.  games/megamaze:GAMES/MEGAMAZE games/padenie:GAMES/PADENIE \
  264.  games/reversi:GAMES/REVERSI games/rforces:GAMES/RFORCES \
  265.  games/whowtbam:GAMES/WHOWTBAM games/xonix:GAMES/XONIX \
  266.  lib/msgbox.obj:LIB/MSGBOX.OBJ \
  267.  lib/pixlib.obj:LIB/PIXLIB.OBJ lib/sort.obj:LIB/SORT.OBJ \
  268.  drivers/intel_hda.obj:DRIVERS/intel_hda.obj \
  269.  media/ac97snd:MEDIA/AC97SND \
  270.  network/jmail:NETWORK/JMAIL network/zeroconf.ini:NETWORK/ZEROCONF.INI \
  271. #end of list
  272. #3d/logio.bmp:3D/LOGIO.BMP 3d/cubetext:3D/CUBETEXT
  273.  
  274. # Extra targets for LiveCD image in the syntax of mkisofs
  275. MKISOFS_EXTRA:=\
  276.  dosbox/=$(PROGS)/emulator/DosBox/dosbox \
  277.  dosbox/=$(PROGS)/emulator/DosBox/dosbox.conf \
  278.  dosbox/=$(PROGS)/emulator/DosBox/readme.txt \
  279.  /=drivers/atikms \
  280.  /=drivers/atikms.dll \
  281. #end of list
  282.  
  283. # Some macro for convenient work.
  284. # Macros for replacing '|' to escaped space '\ '.
  285. space:=\ #plus space
  286. respace=$(subst |,$(space),$(1))
  287. # Macro for selecting different parts of ':'-separated items.
  288. binarypart=$(word 1,$(subst :, ,$(1)))
  289. imagepart=$(word 2,$(subst :, ,$(1)))
  290. sourcepart=$(word 3,$(subst :, ,$(1)))
  291. parampart=$(word 4,$(subst :, ,$(1)))
  292. # Get file names, possibly with spaces inside, from an item.
  293. # Here $(f) is an item - in fact, macro argument.
  294. fbinary=$(call respace,$(call binarypart,$(f)))
  295. fimage=$(call respace,$(call imagepart,$(f)))
  296. fsource=$(call respace,$(call sourcepart,$(f)))
  297. fparam=$(call respace,$(call parampart,$(f)))
  298.  
  299. # Define targets for image file.
  300. # Join all the lists above.
  301. targets_full:=$(COPY_FILES) $(FASM_PROGRAMS) $(NASM_PROGRAMS) $(OTHER_FILES) $(CMM_PROGRAMS)
  302. # For each item in the united list call fbinary.
  303. targets:=$(foreach f,$(targets_full),$(fbinary))
  304.  
  305. # Define a command for copying a file inside the image.
  306. # mcopy_command is a macro with two parameters,
  307. # local file name $(1) and image file name $(2).
  308. # Note that spaces in these have to be escaped with backslashes.
  309. mcopy_command=mcopy -moi $(BUILD_DIR)/kolibri.img $(1) ::$(2)
  310. # Specialize a previous command for an item $(f) in one of lists.
  311. mcopy_item_command=$(call mcopy_command,$(fbinary),$(fimage))
  312.  
  313. # Join all $(mcopy_item_command) for all items,
  314. # append newline after each item.
  315. # The first newline character after "define" line and
  316. # the last newline character before "endef" line get away
  317. # with define/endef, so we make three newline characters,
  318. # that is two empty lines, in order to get one in $(newline).
  319. define newline
  320.  
  321.  
  322. endef
  323. mcopy_all_items:=$(foreach f,$(targets_full),$(mcopy_item_command)$(newline))
  324.  
  325. # dependencies of MKISOFS_EXTRA; we iterate through $(MKISOFS_EXTRA),
  326. # substitute "=" with space, get the 2nd word and join all results
  327. mkisofs_extra_targets:=$(foreach f,$(MKISOFS_EXTRA),$(word 2,$(subst =, ,$(f))))
  328.  
  329. # The main goal: build kolibri.img and kolibri.iso
  330. all: $(BUILD_DIR)/kolibri.img $(BUILD_DIR)/kolibri.iso
  331.  
  332. # The first goal: floppy image.
  333. $(BUILD_DIR)/kolibri.img: $(BUILD_DIR)/.dir \
  334.  Makefile \
  335.  $(BUILD_DIR)/boot_fat12.bin \
  336.  $(targets)
  337. # SYSXTREE
  338. # 3d/CUBETEXT
  339. # 3d/LOGIO.BMP
  340.         str=`LANG=ru_RU.utf8 date -u +"[автосборка %d %b %Y %R, r$(REV)]"|iconv -f utf8 -t cp866`; \
  341.         echo -n $$str|dd of=kernel.mnt bs=1 seek=`expr 279 - length "$$str"` conv=notrunc 2>/dev/null
  342.         dd if=/dev/zero of=$(BUILD_DIR)/kolibri.img count=2880 bs=512 2>&1
  343.         mformat -f 1440 -i $(BUILD_DIR)/kolibri.img ::
  344.         dd if=$(BUILD_DIR)/boot_fat12.bin of=$(BUILD_DIR)/kolibri.img count=1 bs=512 conv=notrunc 2>&1
  345.         mmd -i $(BUILD_DIR)/kolibri.img ::3D
  346.         mmd -i $(BUILD_DIR)/kolibri.img ::DEMOS
  347.         mmd -i $(BUILD_DIR)/kolibri.img ::DEVELOP
  348.         mmd -i $(BUILD_DIR)/kolibri.img ::DRIVERS
  349.         mmd -i $(BUILD_DIR)/kolibri.img ::File\ Managers
  350.         mmd -i $(BUILD_DIR)/kolibri.img ::FONTS
  351.         mmd -i $(BUILD_DIR)/kolibri.img ::GAMES
  352.         mmd -i $(BUILD_DIR)/kolibri.img ::INFO
  353.         mmd -i $(BUILD_DIR)/kolibri.img ::LIB
  354.         mmd -i $(BUILD_DIR)/kolibri.img ::MEDIA
  355.         mmd -i $(BUILD_DIR)/kolibri.img ::NETWORK
  356.         $(mcopy_all_items)
  357.  
  358. # The second goal: LiveCD image.
  359. $(BUILD_DIR)/kolibri.iso: $(BUILD_DIR)/kolibri.img $(mkisofs_extra_targets)
  360.         mkisofs -U -J -pad -b kolibri.img -c boot.catalog -hide-joliet boot.catalog -hide-joliet kolibri.img -graft-points \
  361.         -A "KolibriOS AutoBuilder" -p "CleverMouse" -publisher "KolibriOS Team" -V "KolibriOS r$(REV)" -sysid "KOLIBRI" \
  362.         -iso-level 3 -o $(BUILD_DIR)/kolibri.iso $(BUILD_DIR)/kolibri.img $(MKISOFS_EXTRA) 2>&1
  363.  
  364. # Special targets to modify behaviour of make.
  365. .DELETE_ON_ERROR:
  366. .SUFFIXES: # disable all predefined rules
  367.  
  368. # The floppy bootsector.
  369. $(BUILD_DIR)/boot_fat12.bin: $(KERNEL)/bootloader/boot_fat12.asm $(KERNEL)/bootloader/floppy1440.inc
  370.         fasm $(KERNEL)/bootloader/boot_fat12.asm $(BUILD_DIR)/boot_fat12.bin
  371.  
  372. $(BUILD_DIR)/.dir 3d/.dir demos/.dir develop/.dir info/.dir drivers/.dir fonts/.dir \
  373.  games/.dir lib/.dir media/.dir network/.dir .deps/.dir:
  374.         mkdir -p $(dir $@)
  375.         touch $@
  376. File\ Managers/.dir:
  377.         mkdir -p "File Managers"
  378.         touch "File Managers/.dir"
  379.  
  380. # FASM black magic goes to Makefile.fasm.
  381. include Makefile.fasm
  382.  
  383. # Similar for NASM.
  384. include Makefile.nasm
  385.  
  386. # Similar for copying files.
  387. include Makefile.copy
  388.  
  389. # Special rules for copying sysfuncr.txt - it isn't directly included in the image.
  390. docpak: $(DOCDIR)SYSFUNCR.TXT $(wildcard $(DOCDIR)*)
  391. $(DOCDIR)SYSFUNCR.TXT: $(KERNEL)/docs/sysfuncr.txt
  392.         cp $(KERNEL)/docs/sysfuncr.txt $(DOCDIR)SYSFUNCR.TXT
  393.  
  394. # Similar for C--.
  395. include Makefile.cmm
  396.  
  397. # Sorry, even black magic seems to be insufficient for
  398. # auto-handling all subtle effects. So we just define
  399. # command lines for compiling and linking, and
  400. # maintain the list of sources and objects by hand.
  401. include Makefile.msvc
  402.  
  403. # Rules for table
  404. table: .obj.table/table.exe
  405.         $(msvc_final)
  406. TABLE_OBJECTS:=.obj.table/calc.obj .obj.table/func.obj .obj.table/hello.obj \
  407.  .obj.table/KosFile.obj .obj.table/kosSyst.obj .obj.table/math2.obj \
  408.  .obj.table/mcsmemm.obj .obj.table/parser.obj
  409. TABLE_H_FILES:=$(wildcard $(PROGS)/other/table/*.h)
  410. .obj.table/table.exe: $(TABLE_OBJECTS)
  411.         $(msvc_link)
  412. $(TABLE_OBJECTS): .obj.table/%.obj: $(PROGS)/other/table/%.cpp $(TABLE_H_FILES) Makefile.msvc | .obj.table
  413.         $(msvc_compile)
  414. .obj.table:
  415.         mkdir -p .obj.table
  416.  
  417. # Rules for graph
  418. graph: .obj.graph/graph.exe
  419.         $(msvc_final)
  420. GRAPH_CPP_OBJECTS:=.obj.graph/func.obj .obj.graph/hello.obj .obj.graph/kolibri.obj \
  421.  .obj.graph/KosFile.obj .obj.graph/kosSyst.obj .obj.graph/math2.obj \
  422.  .obj.graph/mcsmemm.obj .obj.graph/parser.obj
  423. GRAPH_C_OBJECTS:=.obj.graph/string.obj
  424. GRAPH_H_FILES:=$(wildcard $(PROGS)/other/graph/*.h)
  425. GRAPH_FASM_OBJECTS:=.obj.graph/memcpy.obj .obj.graph/memset.obj
  426. .obj.graph/graph.exe: $(GRAPH_CPP_OBJECTS) $(GRAPH_C_OBJECTS) $(GRAPH_FASM_OBJECTS)
  427.         $(msvc_link)
  428. $(GRAPH_CPP_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.cpp $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
  429.         $(msvc_compile)
  430. $(GRAPH_C_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.c $(GRAPH_H_FILES) Makefile.msvc | .obj.graph
  431.         $(msvc_compile)
  432. $(GRAPH_FASM_OBJECTS): .obj.graph/%.obj: $(PROGS)/other/graph/%.asm Makefile.msvc | .obj.graph
  433.         fasm $< $@
  434. .obj.graph:
  435.         mkdir -p .obj.graph
  436.  
  437. # Rules for kosilka
  438. games/kosilka: .obj.kosilka/kosilka.exe
  439.         $(msvc_final)
  440. KOSILKA_OBJECTS:=.obj.kosilka/kosilka.obj .obj.kosilka/KosFile.obj .obj.kosilka/kosSyst.obj .obj.kosilka/mcsmemm.obj
  441. KOSILKA_H_FILES:=$(PROGS)/games/kosilka/*.h
  442. .obj.kosilka/kosilka.exe: $(KOSILKA_OBJECTS)
  443.         $(msvc_link)
  444. $(KOSILKA_OBJECTS): .obj.kosilka/%.obj: $(PROGS)/games/kosilka/%.cpp $(KOSILKA_H_FILES) Makefile.msvc | .obj.kosilka
  445.         $(msvc_compile)
  446. .obj.kosilka:
  447.         mkdir -p .obj.kosilka
  448.  
  449. include Makefile.gcc
  450.  
  451. # Rules for shell
  452. 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 \
  453.  $(PROGS)/system/shell/kolibri.ld
  454.         $(call gcc_link,$(PROGS)/system/shell/kolibri.ld)
  455. .obj.shell/shell.o: $(PROGS)/system/shell/shell.c \
  456.  $(PROGS)/system/shell/all.h \
  457.  $(PROGS)/system/shell/system/*.h \
  458.  $(PROGS)/system/shell/cmd/*.c \
  459.  $(PROGS)/system/shell/modules/*.c \
  460.  $(PROGS)/system/shell/locale/rus/globals.h \
  461.  Makefile.gcc | .obj.shell
  462.         $(gcc_compile)
  463. .obj.shell/kolibri.o .obj.shell/stdlib.o .obj.shell/string.o .obj.shell/ctype.o: .obj.shell/%.o: \
  464.  $(PROGS)/system/shell/system/%.c $(PROGS)/system/shell/system/*.h \
  465.  Makefile.gcc | .obj.shell
  466.         $(gcc_compile)
  467. .obj.shell/start.o: $(PROGS)/system/shell/start.asm | .obj.shell
  468.         fasm $< $@
  469. .obj.shell:
  470.         mkdir -p .obj.shell
  471.  
  472. # Rules for e80
  473. E80DIR=$(PROGS)/emulator/e80/trunk
  474. 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
  475.         $(call gcc_link,$(E80DIR)/kolibri.ld)
  476. .obj.e80/e80.o: $(E80DIR)/e80.c $(E80DIR)/48.h \
  477.  $(E80DIR)/system/*.h $(E80DIR)/system/msgbox.c \
  478.  $(E80DIR)/z80/z80.h Makefile.gcc | .obj.e80
  479.         $(gcc_compile)
  480. .obj.e80/kolibri.o .obj.e80/stdlib.o .obj.e80/string.o: .obj.e80/%.o: \
  481.  $(E80DIR)/system/%.c $(E80DIR)/system/*.h Makefile.gcc | .obj.e80
  482.         $(gcc_compile)
  483. .obj.e80/z80.o: $(E80DIR)/z80/z80.c $(E80DIR)/z80/*
  484.         $(gcc_compile)
  485. .obj.e80/start.o: $(E80DIR)/asm_code.asm | .obj.e80
  486.         fasm $< $@
  487. .obj.e80:
  488.         mkdir -p .obj.e80
  489.  
  490. # Rules for sdk/sound, used by media/ac97snd
  491. SOUNDDIR=$(PROGS)/develop/sdk/trunk/sound/src
  492. SOUND_OBJECTS:=$(patsubst $(SOUNDDIR)/%.asm,.sdk/%.obj,$(wildcard $(SOUNDDIR)/*.asm))
  493. SOUND_INC_FILES:=$(wildcard $(SOUNDDIR)/*.inc)
  494. .sdk/sound.lib: $(SOUND_OBJECTS)
  495.         win32-link /lib /out:$@ $^
  496. $(SOUND_OBJECTS): .sdk/%.obj: $(SOUNDDIR)/%.asm $(SOUND_INC_FILES) | .sdk
  497.         fasm $< $@
  498. .sdk:
  499.         mkdir -p .sdk
  500. # Rules for media/ac97snd
  501. AC97DIR=$(PROGS)/media/ac97snd
  502. media/ac97snd: .obj.ac97snd/ac97snd.exe
  503.         $(msvc_final)
  504. .obj.ac97snd/ac97snd.exe: .obj.ac97snd/ac97wav.obj .obj.ac97snd/crt.obj .obj.ac97snd/k_lib.obj \
  505.         .obj.ac97snd/mpg.lib .sdk/sound.lib .obj.ac97snd/ufmod.obj
  506.         $(msvc_link)
  507. .obj.ac97snd/ac97wav.obj: $(AC97DIR)/ac97snd/ac97wav.c \
  508.         $(AC97DIR)/kolibri.h $(AC97DIR)/ac97snd/ac97wav.h $(AC97DIR)/mpg/mpg123.h \
  509.         $(AC97DIR)/sound.h $(AC97DIR)/ufmod-codec.h Makefile.msvc | .obj.ac97snd
  510.         $(msvc_compile)
  511. .obj.ac97snd/crt.obj: $(AC97DIR)/ac97snd/crt.c $(AC97DIR)/ac97snd/crt.h Makefile.msvc | .obj.ac97snd
  512.         $(msvc_compile)
  513. .obj.ac97snd/k_lib.obj: $(AC97DIR)/ac97snd/k_lib.asm $(AC97DIR)/ac97snd/proc32.inc | .obj.ac97snd
  514.         fasm $< $@
  515. .obj.ac97snd/ufmod.obj: $(AC97DIR)/ufmod-config.asm | .obj.ac97snd
  516.         fasm $< $@ -s .deps/ac97snd-ufmod.fas
  517.         prepsrc .deps/ac97snd-ufmod.fas /dev/stdout | \
  518.         perl -n -e 's|\\|/|g;s| |\\ |g;push @a,$$1 if/^;include\\ \x27(.*?)\x27/;' \
  519.         -e 'END{$$a=join " \\\n ",@a;print "$@: $$a\n$$a:\n"}' > .deps/ac97snd-ufmod.Po
  520. -include .deps/ac97snd-ufmod.Po
  521. AC97SND_MPG_C_FILES:=$(wildcard $(AC97DIR)/mpg/*.c)
  522. AC97SND_MPG_H_FILES:=$(wildcard $(AC97DIR)/mpg/*.h)
  523. AC97SND_MPG_C_OBJECTS:=$(patsubst $(AC97DIR)/mpg/%.c,.obj.ac97snd/%.o,$(AC97SND_MPG_C_FILES))
  524. .obj.ac97snd/mpg.lib: $(AC97SND_MPG_C_OBJECTS) .obj.ac97snd/pow.obj
  525.         win32-link /lib /ltcg /out:$@ $^
  526. $(AC97SND_MPG_C_OBJECTS): .obj.ac97snd/%.o: $(AC97DIR)/mpg/%.c $(AC97SND_MPG_H_FILES) Makefile.msvc | .obj.ac97snd
  527.         $(msvc_compile)
  528. .obj.ac97snd/pow.obj: $(AC97DIR)/mpg/pow.asm $(AC97DIR)/mpg/proc32.inc | .obj.ac97snd
  529.         fasm $< $@
  530. .obj.ac97snd:
  531.         mkdir -p .obj.ac97snd
  532.  
  533. # Rules for atikms.dll
  534. # Use Makefile from $(REPOSITORY)/drivers/ddk and $(REPOSITORY)/drivers/video/drm/radeon
  535. # However, dependencies must be duplicated - I don't know how to avoid this
  536. # without need to rebuild kolibri.img at every iteration...
  537. # Note that we are going to write in the directory shared
  538. # between all Makefiles, so we need locked operations.
  539. drivers/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll drivers/.dir
  540.         kpack --nologo $< $@
  541. $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: $(REPOSITORY)/drivers/video/drm/radeon/Makefile.lto
  542.         flock $(REPOSITORY)/drivers/video/drm/radeon/.lock \
  543.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/video/drm/radeon -f Makefile.lto
  544. $(REPOSITORY)/drivers/ddk/libddk.a: $(REPOSITORY)/drivers/ddk/Makefile
  545.         flock $(REPOSITORY)/drivers/ddk/.lock \
  546.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libddk.a
  547. $(REPOSITORY)/drivers/ddk/libcore.a: $(REPOSITORY)/drivers/ddk/Makefile
  548.         flock $(REPOSITORY)/drivers/ddk/.lock \
  549.         $(MAKE) CC=win32-gcc45 AS=win32-as LD=win32-ld AR=win32-ar FASM=fasm -C $(REPOSITORY)/drivers/ddk libcore.a
  550. # dependencies
  551. $(REPOSITORY)/drivers/video/drm/radeon/atikms.dll: \
  552.  $(REPOSITORY)/drivers/video/drm/radeon/atikms.lds \
  553.  $(REPOSITORY)/drivers/ddk/libddk.a \
  554.  $(REPOSITORY)/drivers/ddk/libcore.a \
  555.  $(REPOSITORY)/drivers/video/drm/radeon/*.[Sch] \
  556.  $(REPOSITORY)/drivers/video/drm/radeon/*.asm \
  557.  $(REPOSITORY)/drivers/video/drm/radeon/Makefile \
  558.  $(REPOSITORY)/drivers/video/drm/radeon/firmware/*.bin \
  559.  $(REPOSITORY)/drivers/include/*.h \
  560.  $(REPOSITORY)/drivers/include/*/*.h \
  561.  $(REPOSITORY)/drivers/include/*/*/*.h \
  562.  $(REPOSITORY)/drivers/include/*/*/*/*.h
  563. $(REPOSITORY)/drivers/ddk/libddk.a: \
  564.  $(REPOSITORY)/drivers/ddk/*/* \
  565.  $(REPOSITORY)/drivers/include/*.h \
  566.  $(REPOSITORY)/drivers/include/*/*.h \
  567.  $(REPOSITORY)/drivers/include/*/*/*.h \
  568.  $(REPOSITORY)/drivers/include/*/*/*/*.h
  569. $(REPOSITORY)/drivers/ddk/libcore.a: \
  570.  $(REPOSITORY)/drivers/ddk/core.S
  571.