Rev 3274 | Rev 7475 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3274 | Rev 5083 | ||
---|---|---|---|
1 | @echo off |
1 | @echo off |
2 | cls |
2 | cls |
3 | set languages=en ru ge et sp |
3 | set languages=en ru ge et sp |
4 | set drivers=com_mouse emu10k1x fm801 infinity sis sound viasound vt823x |
- | |
5 | set targets=all kernel drivers clean |
4 | set targets=kernel clean |
6 | 5 | ||
7 | call :Check_Target %1 |
6 | call :Check_Target %1 |
8 | for %%a in (all kernel) do if %%a==%target% call :Check_Lang %2 |
7 | for %%a in (kernel) do if %%a==%target% call :Check_Lang %2 |
9 | call :Target_%target% |
8 | call :Target_%target% |
10 | 9 | ||
11 | if ERRORLEVEL 0 goto Exit_OK |
10 | if ERRORLEVEL 0 goto Exit_OK |
12 | 11 | ||
13 | echo There was an error executing script. |
12 | echo There was an error executing script. |
14 | echo For any help, please send a report. |
13 | echo For any help, please send a report. |
15 | pause |
14 | pause |
16 | goto :eof |
15 | goto :eof |
17 | 16 | ||
18 | 17 | ||
19 | 18 | ||
20 | 19 | ||
21 | :Check_Lang |
20 | :Check_Lang |
22 | set res=%1 |
21 | set res=%1 |
23 | :Check_Lang_loop |
22 | :Check_Lang_loop |
24 | for %%a in (%languages%) do if %%a==%res% set lang=%res% |
23 | for %%a in (%languages%) do if %%a==%res% set lang=%res% |
25 | if defined lang goto :eof |
24 | if defined lang goto :eof |
26 | 25 | ||
27 | echo Language '%res%' is incorrect |
26 | echo Language '%res%' is incorrect |
28 | echo Enter valid language [ %languages% ]: |
27 | echo Enter valid language [ %languages% ]: |
29 | 28 | ||
30 | set /P res="> |
29 | set /P res="> |
31 | goto Check_Lang_loop |
30 | goto Check_Lang_loop |
32 | goto :eof |
31 | goto :eof |
33 | 32 | ||
34 | :Check_Target |
33 | :Check_Target |
35 | set res=%1 |
34 | set res=%1 |
36 | :Check_Target_loop |
35 | :Check_Target_loop |
37 | for %%a in (%targets%) do if %%a==%res% set target=%res% |
36 | for %%a in (%targets%) do if %%a==%res% set target=%res% |
38 | if defined target goto :eof |
37 | if defined target goto :eof |
39 | 38 | ||
40 | echo Target '%res%' is incorrect |
39 | echo Target '%res%' is incorrect |
41 | echo Enter valid target [ %targets% ]: |
40 | echo Enter valid target [ %targets% ]: |
42 | 41 | ||
43 | set /P res="> |
42 | set /P res="> |
44 | goto Check_Target_loop |
43 | goto Check_Target_loop |
45 | goto :eof |
44 | goto :eof |
46 | 45 | ||
47 | 46 | ||
48 | :Target_kernel |
47 | :Target_kernel |
49 | echo *** building kernel with language '%lang%' ... |
48 | echo *** building kernel with language '%lang%' ... |
50 | 49 | ||
51 | if not exist bin mkdir bin |
50 | if not exist bin mkdir bin |
52 | echo lang fix %lang% > lang.inc |
51 | echo lang fix %lang% > lang.inc |
53 | fasm -m 65536 kernel.asm bin\kernel.mnt |
52 | fasm -m 65536 kernel.asm bin\kernel.mnt |
54 | if not %errorlevel%==0 goto :Error_FasmFailed |
53 | if not %errorlevel%==0 goto :Error_FasmFailed |
55 | erase lang.inc |
54 | erase lang.inc |
56 | goto :eof |
55 | goto :eof |
57 | 56 | ||
58 | - | ||
59 | :Target_all |
- | |
60 | call :Target_kernel |
- | |
61 | call :Target_drivers |
- | |
62 | goto :eof |
- | |
63 | - | ||
64 | - | ||
65 | :Target_drivers |
- | |
66 | echo *** building drivers ... |
- | |
67 | - | ||
68 | if not exist bin\drivers mkdir bin\drivers |
- | |
69 | cd drivers |
- | |
70 | for %%a in (%drivers%) do ( |
- | |
71 | fasm -m 65536 %%a.asm ..\bin\drivers\%%a.obj |
- | |
72 | if not %errorlevel%==0 goto :Error_FasmFailed |
- | |
73 | ) |
- | |
74 | cd .. |
- | |
75 | - | ||
76 | kpack >nul 2>&1 |
- | |
77 | - | ||
78 | if %errorlevel%==9009 goto :Error_KpackFailed |
- | |
79 | - | ||
80 | echo * |
- | |
81 | echo ############################################## |
- | |
82 | echo * |
- | |
83 | echo Kpack KolibriOS drivers? |
- | |
84 | echo * |
- | |
85 | - | ||
86 | set /P res=[y/n]? |
- | |
87 | - | ||
88 | if "%res%"=="y" ( |
- | |
89 | - | ||
90 | echo * |
- | |
91 | echo Compressing system |
- | |
92 | - | ||
93 | echo * |
- | |
94 | for %%a in (bin\drivers\*.obj) do ( |
- | |
95 | echo ================== kpack %%a |
- | |
96 | kpack %%a |
- | |
97 | if not %errorlevel%==0 goto :Error_KpackFailed |
- | |
98 | ) |
- | |
99 | - | ||
100 | ) |
- | |
101 | goto :eof |
- | |
102 | - | ||
103 | 57 | ||
104 | :Target_clean |
58 | :Target_clean |
105 | echo *** cleaning ... |
59 | echo *** cleaning ... |
106 | rmdir /S /Q bin |
60 | rmdir /S /Q bin |
107 | goto :Exit_OK |
61 | goto :Exit_OK |
108 | 62 | ||
109 | 63 | ||
110 | :Error_FasmFailed |
64 | :Error_FasmFailed |
111 | echo error: fasm execution failed |
65 | echo error: fasm execution failed |
112 | erase lang.inc >nul 2>&1 |
66 | erase lang.inc >nul 2>&1 |
113 | echo. |
67 | echo. |
114 | pause |
68 | pause |
115 | exit 1 |
- | |
116 | - | ||
117 | :Error_KpackFailed |
- | |
118 | echo *** NOTICE *** |
- | |
119 | echo If you want to pack all applications you may |
- | |
120 | echo place "kpack" in accessible directory or system %PATH%. |
- | |
121 | echo You can get this tool from KolibriOS distribution kit. |
- | |
122 | pause |
- | |
123 | exit 1 |
69 | exit 1 |
124 | 70 | ||
125 | :Exit_OK |
71 | :Exit_OK |
126 | echo. |
72 | echo. |
127 | echo all operations have been done |
73 | echo all operations have been done |
128 | pause |
74 | pause |
129 | exit 0 |
75 | exit 0 |