-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuildrepoidw.cmd
165 lines (121 loc) · 3.34 KB
/
buildrepoidw.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
@echo off
REM ///////////////////////////////////////////////////////////////////////////
REM buildrepoidw.cmd
REM ///////////////////////////////////////////////////////////////////////////
pushd %~dp0
REM //
REM // Verify that the script is running under the sizzle environment.
REM //
if [%NTROOT%] equ [] (
echo You must run this script under the sizzle environment.
goto End
)
REM //
REM // Display build information.
REM //
echo Building repository-specific IDW tools from the source tree SDKTOOLS project.
echo.
echo Repository Name = %NTREPO%
echo SDKTOOLS Project Path = %NTROOT%\sdktools
echo Repository IDW Path = %BEREPOIDW%
echo.
REM //
REM // Check for existing IDW path.
REM //
if exist "%BEREPOIDW%" (
REM Check for the -y switch before attempting to delete the repository IDW directory.
if not [%1] equ [-y] (
echo Repository IDW path already exists.
echo Please specify -y switch if you would like to rebuild the repository-specific IDW.
goto End
)
REM Delete the existing repository IDW directory.
rmdir /s /q "%BEREPOIDW%"
)
REM //
REM // Create the repository IDW directory.
REM //
mkdir "%BEREPOIDW%"
REM //
REM // Build repository IDW tools.
REM //
call :Build ztools sdktools\ztools
if errorlevel 1 goto Error
call :Build generr sdktools\generr idw\generr.exe generr.exe
if errorlevel 1 goto Error
call :Build genlvl sdktools\genlvl bldtools\genlvl.exe genlvl.exe
if errorlevel 1 goto Error
call :Build gensrv sdktools\gensrv idw\gensrv.exe gensrv.exe
if errorlevel 1 goto Error
call :Build genxx base\tools\genxx idw\genxx.exe genxx.exe
if errorlevel 1 goto Error
call :Build hdivide sdktools\hdivide bldtools\hdivide.exe hdivide.exe
if errorlevel 1 goto Error
call :Build hextract sdktools\hextract bldtools\hextract.exe hextract.exe
if errorlevel 1 goto Error
call :Build hsplit sdktools\hsplit bldtools\hsplit.exe hsplit.exe
if errorlevel 1 goto Error
call :Build munge sdktools\munge idw\munge.exe munge.exe
if errorlevel 1 goto Error
call :Build wcshdr sdktools\wcshdr bldtools\wcshdr.exe wcshdr.exe
if errorlevel 1 goto Error
call :Build wmimofck sdktools\wmimofck mstools\wmimofck.exe wmimofck.exe
if errorlevel 1 goto Error
call :Build zwapi sdktools\zwapi bldtools\zwapi.exe zwapi.exe
if errorlevel 1 goto Error
REM //
REM // Done.
REM //
echo.
echo Build successfully completed! Done.
goto End
REM //
REM // Error.
REM //
:Error
echo.
echo Error! Build aborted.
REM //
REM // End.
REM //
:End
popd
exit /b 0
REM //
REM // ** Build Function **
REM //
REM // %~1 = Tool name
REM // %~2 = Relative source directory path under %NTROOT%
REM // %~3 = Relative binary path under %NTTREE%
REM // %~4 = Relative binary path under %BEREPOIDW%
REM //
:Build
echo.
echo [%~1]
REM //
REM // Verify that the source directory for the specified tool exists.
REM //
if not exist "%NTROOT%\%~2" (
echo %~1 does not exist in the local source tree. Skipping %~1 build.
exit /b
)
cd "%NTROOT%\%~2"
REM //
REM // Perform build.
REM //
build -c
if errorlevel 1 (
echo Build command failed for %~1.
exit /b 1
)
REM //
REM // Copy the built tool to the repository idw directory.
REM //
if not [%~3] equ [] (
copy /y "%NTTREE%\%~3" "%BEREPOIDW%\%~4"
if errorlevel 1 (
echo Failed to copy %~1 to tools directory.
exit /b 2
)
)
exit /b 0