Rev 3274 | Rev 7475 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3274 | esevece | 1 | @echo off |
2 | cls |
||
3 | set languages=en ru ge et sp |
||
5083 | clevermous | 4 | set targets=kernel clean |
3274 | esevece | 5 | |
6 | call :Check_Target %1 |
||
5083 | clevermous | 7 | for %%a in (kernel) do if %%a==%target% call :Check_Lang %2 |
3274 | esevece | 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 |
||
52 | fasm -m 65536 kernel.asm bin\kernel.mnt |
||
53 | if not %errorlevel%==0 goto :Error_FasmFailed |
||
54 | erase lang.inc |
||
55 | goto :eof |
||
56 | |||
57 | |||
58 | :Target_clean |
||
59 | echo *** cleaning ... |
||
60 | rmdir /S /Q bin |
||
61 | goto :Exit_OK |
||
62 | |||
63 | |||
64 | :Error_FasmFailed |
||
65 | echo error: fasm execution failed |
||
66 | erase lang.inc >nul 2>&1 |
||
67 | echo. |
||
68 | pause |
||
69 | exit 1 |
||
70 | |||
71 | :Exit_OK |
||
72 | echo. |
||
73 | echo all operations have been done |
||
74 | pause |
||
75 | exit 0 |