Subversion Repositories Kolibri OS

Rev

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

  1. @echo off
  2.  
  3. set languages=en ru ge et
  4. set drivers=sound sis infinity ensoniq ps2mouse com_mouse uart ati2d vmode
  5. set targets=all kernel drivers skins clean
  6.  
  7. call :Check_Target %1
  8. for %%a in (all kernel) do if %%a==%target% call :Check_Lang %2
  9. call :Target_%target%
  10.  
  11. if ERRORLEVEL 0 goto Exit_OK
  12.  
  13. echo There was an error executing script.
  14. echo For any help, please send a report.
  15. pause
  16. goto :eof
  17.  
  18.  
  19.  
  20.  
  21. :Check_Lang
  22.    set res=%1
  23.   :Check_Lang_loop
  24.    for %%a in (%languages%) do if %%a==%res% set lang=%res%
  25.    if defined lang goto :eof
  26.  
  27.    echo Language '%res%' is incorrect
  28.    echo Enter valid language [ %languages% ]:
  29.  
  30.    set /P res=">
  31.    goto Check_Lang_loop
  32. goto :eof
  33.  
  34. :Check_Target
  35.    set res=%1
  36.   :Check_Target_loop
  37.    for %%a in (%targets%) do if %%a==%res% set target=%res%
  38.    if defined target goto :eof
  39.  
  40.    echo Target '%res%' is incorrect
  41.    echo Enter valid target [ %targets% ]:
  42.  
  43.    set /P res=">
  44.    goto Check_Target_loop
  45. goto :eof
  46.  
  47.  
  48. :Target_kernel
  49.    echo *** building kernel with language '%lang%' ...
  50.  
  51.    if not exist bin mkdir bin
  52.    echo lang fix %lang% > lang.inc
  53.    fasm -m 65536 kernel.asm bin\kernel.mnt
  54.    if not %errorlevel%==0 goto :Error_FasmFailed
  55.    erase lang.inc
  56. goto :eof
  57.  
  58.  
  59. :Target_all
  60.    call :Target_kernel
  61.    call :Target_drivers
  62.    call :Target_skins
  63. goto :eof
  64.  
  65.  
  66. :Target_drivers
  67.    echo *** building drivers ...
  68.  
  69.    if not exist bin\drivers mkdir bin\drivers
  70.    cd drivers
  71.    for %%a in (%drivers%) do (
  72.      fasm -m 65536 %%a.asm ..\bin\drivers\%%a.obj
  73.      if not %errorlevel%==0 goto :Error_FasmFailed
  74.    )
  75.    cd ..
  76.    move bin\drivers\vmode.obj bin\drivers\vmode.mdr
  77. goto :eof
  78.  
  79.  
  80. :Target_skins
  81.    echo *** building skins ...
  82.  
  83.    if not exist bin\skins mkdir bin\skins
  84.    cd skin
  85.    fasm -m 65536 default.asm ..\bin\skins\default.skn
  86.    if not %errorlevel%==0 goto :Error_FasmFailed
  87.    cd ..
  88. goto :eof
  89.  
  90. :Target_clean
  91.    echo *** cleaning ...
  92.    rmdir /S /Q bin
  93. goto :Exit_OK
  94.  
  95.  
  96. :Error_FasmFailed
  97. echo error: fasm execution failed
  98. erase lang.inc
  99. pause
  100. exit 1
  101.  
  102. :Exit_OK
  103. echo all operations has been done
  104. pause
  105. exit 0
  106.