2006-12-10 17:34:19 +01:00
|
|
|
@echo off
|
2009-05-30 21:30:15 +02:00
|
|
|
cls
|
2007-01-11 17:16:05 +01:00
|
|
|
set languages=en ru ge et
|
2011-10-05 13:13:17 +02:00
|
|
|
set drivers=com_mouse emu10k1x fm801 infinity sis sound viasound vt823x
|
2007-05-30 16:45:45 +02:00
|
|
|
set targets=all kernel drivers skins clean
|
2006-12-10 17:34:19 +01:00
|
|
|
|
2006-12-11 02:22:38 +01:00
|
|
|
call :Check_Target %1
|
|
|
|
for %%a in (all kernel) do if %%a==%target% call :Check_Lang %2
|
|
|
|
call :Target_%target%
|
2006-12-10 17:34:19 +01:00
|
|
|
|
2006-12-11 02:22:38 +01:00
|
|
|
if ERRORLEVEL 0 goto Exit_OK
|
2006-12-10 17:34:19 +01:00
|
|
|
|
2007-04-20 05:21:48 +02:00
|
|
|
echo There was an error executing script.
|
|
|
|
echo For any help, please send a report.
|
2006-12-11 02:22:38 +01:00
|
|
|
pause
|
|
|
|
goto :eof
|
2006-12-10 17:34:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-11 02:22:38 +01:00
|
|
|
:Check_Lang
|
|
|
|
set res=%1
|
|
|
|
:Check_Lang_loop
|
|
|
|
for %%a in (%languages%) do if %%a==%res% set lang=%res%
|
|
|
|
if defined lang goto :eof
|
|
|
|
|
2007-04-20 05:21:48 +02:00
|
|
|
echo Language '%res%' is incorrect
|
|
|
|
echo Enter valid language [ %languages% ]:
|
2006-12-11 02:22:38 +01:00
|
|
|
|
|
|
|
set /P res=">
|
|
|
|
goto Check_Lang_loop
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
:Check_Target
|
|
|
|
set res=%1
|
|
|
|
:Check_Target_loop
|
|
|
|
for %%a in (%targets%) do if %%a==%res% set target=%res%
|
|
|
|
if defined target goto :eof
|
|
|
|
|
2007-04-20 05:21:48 +02:00
|
|
|
echo Target '%res%' is incorrect
|
|
|
|
echo Enter valid target [ %targets% ]:
|
2006-12-11 02:22:38 +01:00
|
|
|
|
|
|
|
set /P res=">
|
|
|
|
goto Check_Target_loop
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:Target_kernel
|
2007-04-20 05:21:48 +02:00
|
|
|
echo *** building kernel with language '%lang%' ...
|
2006-12-11 02:22:38 +01:00
|
|
|
|
|
|
|
if not exist bin mkdir bin
|
|
|
|
echo lang fix %lang% > lang.inc
|
2007-02-24 23:43:17 +01:00
|
|
|
fasm -m 65536 kernel.asm bin\kernel.mnt
|
2006-12-11 02:22:38 +01:00
|
|
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
|
|
|
erase lang.inc
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:Target_all
|
|
|
|
call :Target_kernel
|
|
|
|
call :Target_drivers
|
|
|
|
call :Target_skins
|
|
|
|
goto :eof
|
2006-12-10 17:34:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
:Target_drivers
|
2007-04-20 05:21:48 +02:00
|
|
|
echo *** building drivers ...
|
2006-12-10 17:34:19 +01:00
|
|
|
|
2006-12-11 02:22:38 +01:00
|
|
|
if not exist bin\drivers mkdir bin\drivers
|
|
|
|
cd drivers
|
|
|
|
for %%a in (%drivers%) do (
|
2007-02-24 23:43:17 +01:00
|
|
|
fasm -m 65536 %%a.asm ..\bin\drivers\%%a.obj
|
2006-12-11 02:22:38 +01:00
|
|
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
|
|
|
)
|
|
|
|
cd ..
|
2009-05-30 21:30:15 +02:00
|
|
|
|
2009-05-31 09:57:33 +02:00
|
|
|
kpack >nul 2>&1
|
|
|
|
|
|
|
|
if %errorlevel%==9009 goto :Error_KpackFailed
|
|
|
|
|
2009-05-30 07:08:59 +02:00
|
|
|
echo *
|
|
|
|
echo ##############################################
|
|
|
|
echo *
|
|
|
|
echo Kpack KolibriOS drivers?
|
|
|
|
echo *
|
|
|
|
|
|
|
|
set /P res=[y/n]?
|
|
|
|
|
|
|
|
if "%res%"=="y" (
|
|
|
|
|
2009-05-30 21:30:15 +02:00
|
|
|
echo *
|
|
|
|
echo Compressing system
|
|
|
|
|
|
|
|
echo *
|
|
|
|
for %%a in (bin\drivers\*.obj) do (
|
|
|
|
echo ================== kpack %%a
|
|
|
|
kpack %%a
|
2009-05-31 09:57:33 +02:00
|
|
|
if not %errorlevel%==0 goto :Error_KpackFailed
|
2009-05-30 21:30:15 +02:00
|
|
|
)
|
2009-05-30 07:08:59 +02:00
|
|
|
|
|
|
|
)
|
2006-12-11 02:22:38 +01:00
|
|
|
goto :eof
|
2006-12-10 17:34:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
:Target_skins
|
2007-04-20 05:21:48 +02:00
|
|
|
echo *** building skins ...
|
2006-12-10 17:34:19 +01:00
|
|
|
|
2006-12-11 02:22:38 +01:00
|
|
|
if not exist bin\skins mkdir bin\skins
|
|
|
|
cd skin
|
2007-02-24 23:43:17 +01:00
|
|
|
fasm -m 65536 default.asm ..\bin\skins\default.skn
|
2006-12-11 02:22:38 +01:00
|
|
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
|
|
|
cd ..
|
|
|
|
goto :eof
|
2006-12-10 17:34:19 +01:00
|
|
|
|
|
|
|
:Target_clean
|
2007-04-20 05:21:48 +02:00
|
|
|
echo *** cleaning ...
|
2007-05-12 21:35:34 +02:00
|
|
|
rmdir /S /Q bin
|
2006-12-10 17:34:19 +01:00
|
|
|
goto :Exit_OK
|
|
|
|
|
|
|
|
|
|
|
|
:Error_FasmFailed
|
|
|
|
echo error: fasm execution failed
|
2009-05-30 21:30:15 +02:00
|
|
|
erase lang.inc >nul 2>&1
|
|
|
|
echo.
|
|
|
|
pause
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
:Error_KpackFailed
|
|
|
|
echo *** NOTICE ***
|
2009-05-31 13:46:28 +02:00
|
|
|
echo If you want to pack all applications you may
|
2009-05-31 09:57:33 +02:00
|
|
|
echo place "kpack" in accessible directory or system %PATH%.
|
2009-05-31 13:46:28 +02:00
|
|
|
echo You can get this tool from KolibriOS distribution kit.
|
2006-12-11 02:22:38 +01:00
|
|
|
pause
|
2006-12-10 17:34:19 +01:00
|
|
|
exit 1
|
|
|
|
|
|
|
|
:Exit_OK
|
2009-05-30 21:30:15 +02:00
|
|
|
echo.
|
2009-05-31 13:46:28 +02:00
|
|
|
echo all operations have been done
|
2006-12-11 02:22:38 +01:00
|
|
|
pause
|
2007-04-20 05:21:48 +02:00
|
|
|
exit 0
|