Subversion Repositories Kolibri OS

Rev

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

  1. @echo off
  2. cls
  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.  
  78.  
  79. kpack >nul 2>&1
  80.  
  81. if %errorlevel%==9009 goto :Error_KpackFailed
  82.  
  83. echo *
  84. echo ##############################################
  85. echo *
  86. echo Kpack KolibriOS drivers?
  87. echo *    
  88.  
  89. set /P res=[y/n]?
  90.  
  91. if "%res%"=="y" (
  92.  
  93.   echo *
  94.   echo Compressing system
  95.  
  96.   echo *
  97.   for %%a in (bin\drivers\*.obj) do (
  98.     echo ================== kpack %%a
  99.     kpack %%a
  100.     if not %errorlevel%==0 goto :Error_KpackFailed
  101.   )
  102.  
  103. )
  104. goto :eof
  105.  
  106.  
  107. :Target_skins
  108.    echo *** building skins ...
  109.  
  110.    if not exist bin\skins mkdir bin\skins
  111.    cd skin
  112.    fasm -m 65536 default.asm ..\bin\skins\default.skn
  113.    if not %errorlevel%==0 goto :Error_FasmFailed
  114.    cd ..
  115. goto :eof
  116.  
  117. :Target_clean
  118.    echo *** cleaning ...
  119.    rmdir /S /Q bin
  120. goto :Exit_OK
  121.  
  122.  
  123. :Error_FasmFailed
  124. echo error: fasm execution failed
  125. erase lang.inc >nul 2>&1
  126. echo.
  127. pause
  128. exit 1
  129.  
  130. :Error_KpackFailed
  131. echo   *** NOTICE ***
  132. echo If you want to pack all applications you may
  133. echo place "kpack" in accessible directory or system %PATH%.
  134. echo You can get this tool from KolibriOS distribution kit.
  135. pause
  136. exit 1
  137.  
  138. :Exit_OK
  139. echo.
  140. echo all operations have been done
  141. pause
  142. exit 0
  143.