2010-10-01 13:21:55 +04:00
|
|
|
@echo off
|
|
|
|
cls
|
2013-05-28 23:09:31 +04:00
|
|
|
set languages=en ru ge et sp
|
2014-12-01 06:51:07 +03:00
|
|
|
set targets=kernel clean
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
call :Check_Target %1
|
2014-12-01 06:51:07 +03:00
|
|
|
for %%a in (kernel) do if %%a==%target% call :Check_Lang %2
|
2010-10-01 13:21:55 +04:00
|
|
|
call :Target_%target%
|
|
|
|
|
|
|
|
if ERRORLEVEL 0 goto Exit_OK
|
|
|
|
|
|
|
|
echo There was an error executing script.
|
|
|
|
echo For any help, please send a report.
|
|
|
|
pause
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:Check_Lang
|
|
|
|
set res=%1
|
|
|
|
:Check_Lang_loop
|
|
|
|
for %%a in (%languages%) do if %%a==%res% set lang=%res%
|
|
|
|
if defined lang goto :eof
|
|
|
|
|
|
|
|
echo Language '%res%' is incorrect
|
|
|
|
echo Enter valid language [ %languages% ]:
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
echo Target '%res%' is incorrect
|
|
|
|
echo Enter valid target [ %targets% ]:
|
|
|
|
|
|
|
|
set /P res=">
|
|
|
|
goto Check_Target_loop
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:Target_kernel
|
|
|
|
echo *** building kernel with language '%lang%' ...
|
|
|
|
|
|
|
|
if not exist bin mkdir bin
|
|
|
|
echo lang fix %lang% > lang.inc
|
|
|
|
fasm -m 65536 kernel.asm bin\kernel.mnt
|
|
|
|
if not %errorlevel%==0 goto :Error_FasmFailed
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
|
|
:Target_clean
|
|
|
|
echo *** cleaning ...
|
|
|
|
rmdir /S /Q bin
|
|
|
|
goto :Exit_OK
|
|
|
|
|
|
|
|
|
|
|
|
:Error_FasmFailed
|
|
|
|
echo error: fasm execution failed
|
|
|
|
echo.
|
|
|
|
pause
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
:Exit_OK
|
|
|
|
echo.
|
|
|
|
echo all operations have been done
|
|
|
|
pause
|
|
|
|
exit 0
|