Subversion Repositories Kolibri OS

Rev

Rev 7129 | Rev 7477 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7129 Rev 7475
Line 1... Line -...
1
@echo off
-
 
2
cls
-
 
3
set languages=en ru ge et sp
-
 
4
set targets=kernel clean
-
 
5
 
-
 
6
call :Check_Target %1
-
 
7
for %%a in (kernel) do if %%a==%target% call :Check_Lang %2
-
 
8
call :Target_%target%
-
 
9
 
-
 
10
if ERRORLEVEL 0 goto Exit_OK
-
 
11
 
-
 
12
echo There was an error executing script.
-
 
13
echo For any help, please send a report.
-
 
14
pause
-
 
15
goto :eof
-
 
16
 
-
 
17
 
-
 
18
 
-
 
19
 
-
 
20
:Check_Lang
-
 
21
   set res=%1
-
 
22
  :Check_Lang_loop
-
 
23
   for %%a in (%languages%) do if %%a==%res% set lang=%res%
-
 
24
   if defined lang goto :eof
-
 
25
 
-
 
26
   echo Language '%res%' is incorrect
-
 
27
   echo Enter valid language [ %languages% ]:
-
 
28
 
-
 
29
   set /P res=">
-
 
30
   goto Check_Lang_loop
-
 
31
goto :eof
-
 
32
 
-
 
33
:Check_Target
-
 
34
   set res=%1
-
 
35
  :Check_Target_loop
-
 
36
   for %%a in (%targets%) do if %%a==%res% set target=%res%
-
 
37
   if defined target goto :eof
-
 
38
 
-
 
39
   echo Target '%res%' is incorrect
-
 
40
   echo Enter valid target [ %targets% ]:
-
 
41
 
-
 
42
   set /P res=">
-
 
43
   goto Check_Target_loop
-
 
44
goto :eof
-
 
45
 
-
 
46
 
-
 
47
:Target_kernel
-
 
48
   echo *** building kernel with language '%lang%' ...
-
 
49
 
-
 
50
   if not exist bin mkdir bin
-
 
51
   echo lang fix %lang% > lang.inc
1
echo lang fix %lang% > lang.inc
52
   fasm -m 65536 bootbios.asm bootbios.bin
-
 
53
   fasm -m 65536 kernel.asm bin\kernel.mnt
2
   fasm -m 65536 kernel.asm kernel.mnt
54
   fasm -m 65536 kernel.asm bin\kernel.bin -dUEFI=1
-
 
55
   if not %errorlevel%==0 goto :Error_FasmFailed
-
 
56
   erase lang.inc
-
 
57
goto :eof
-
 
58
 
-
 
59
 
-
 
60
:Target_clean
-
 
61
   echo *** cleaning ...
-
 
62
   rmdir /S /Q bin
-
 
63
goto :Exit_OK
-
 
64
 
-
 
65
 
-
 
66
:Error_FasmFailed
-
 
67
echo error: fasm execution failed
-
 
68
erase lang.inc >nul 2>&1
-
 
69
echo.
-
 
70
pause
-
 
71
exit 1
-
 
72
 
-
 
73
:Exit_OK
-
 
74
echo.
-
 
75
echo all operations have been done
-
 
76
pause
-
 
77
exit 0
-