Added more functionality

git-svn-id: svn://kolibrios.org@232 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
victor 2006-12-11 01:22:38 +00:00
parent 62c4becf44
commit 1ad99d565b

View File

@ -2,86 +2,113 @@
set languages=en ru ge set languages=en ru ge
set drivers=unisound sis infinity ati2d set drivers=unisound sis infinity ati2d
set targets=all kernel drivers skins clean
set opt_ok=0 call :Check_Target %1
for %%a in (%languages%) do if %%a==%1 set opt_ok=1 for %%a in (all kernel) do if %%a==%target% call :Check_Lang %2
if %opt_ok%==0 goto :Check_Targets call :Target_%target%
echo building kernel with language %1 ... if ERRORLEVEL 0 goto Exit_OK
if not exist bin mkdir bin echo Probably at runing has been created error
echo lang fix %1 > lang.inc echo For help send a report...
fasm kernel.asm bin\kernel.mnt pause
if not %errorlevel%==0 goto :Error_FasmFailed goto :eof
erase lang.inc
goto :Exit_OK
:Check_Targets
for %%a in (all drivers skins clean) do if %%a==%1 set opt_ok=1
if %opt_ok%==0 goto :Error_WrongOption
goto :Target_%1 :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 not founded
echo Enter valide languege
echo [%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 not valide
echo Enter valide target
echo [%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 kernel.asm bin\kernel.mnt
if not %errorlevel%==0 goto :Error_FasmFailed
erase lang.inc
goto :eof
:Target_all :Target_all
echo building all ...
call :Target_kernel
call :Target_drivers
call :Target_skins
goto :eof
echo building all ...
if not exist bin mkdir bin
for %%a in (%languages%) do (
echo lang fix %%a > lang.inc
fasm kernel.asm bin\kernel_%%a.mnt
if not %errorlevel%==0 goto :Error_FasmFailed
)
erase lang.inc
call :Target_drivers
call :Target_skins
exit :Exit_OK
:Target_drivers :Target_drivers
echo building drivers ...
echo building drivers ... if not exist bin\drivers mkdir bin\drivers
cd drivers
if not exist bin\drivers mkdir bin\drivers for %%a in (%drivers%) do (
cd drivers
for %%a in (%drivers%) do (
fasm %%a.asm ..\bin\drivers\%%a.obj fasm %%a.asm ..\bin\drivers\%%a.obj
if not %errorlevel%==0 goto :Error_FasmFailed if not %errorlevel%==0 goto :Error_FasmFailed
) )
cd .. cd ..
goto :Exit_OK goto :eof
:Target_skins :Target_skins
echo building skins ...
echo building skins ... if not exist bin\skins mkdir bin\skins
cd skin
fasm default.asm ..\bin\skins\default.skn
if not %errorlevel%==0 goto :Error_FasmFailed
cd ..
goto :eof
if not exist bin\skins mkdir bin\skins
cd skin
fasm default.asm ..\bin\skins\default.skn
if not %errorlevel%==0 goto :Error_FasmFailed
cd ..
goto :Exit_OK
:Target_clean :Target_clean
echo cleaning ...
echo cleaning ... del /Q bin\drivers\*.*
del /Q bin\skins\*.*
del /Q bin\drivers\*.* del /Q bin\*.*
del /Q bin\skins\*.* rmdir bin\drivers
del /Q bin\*.* rmdir bin\skins
rmdir bin\drivers rmdir bin
rmdir bin\skins
rmdir bin
goto :Exit_OK goto :Exit_OK
:Error_WrongOption
echo error: specified option is incorrect - '%1'
exit 1
:Error_FasmFailed :Error_FasmFailed
echo error: fasm execution failed echo error: fasm execution failed
erase lang.inc erase lang.inc
pause
exit 1 exit 1
:Exit_OK :Exit_OK
echo all operations has been done
pause
exit 0