forked from AR1972/NTOSBE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildlocaltool.cmd
55 lines (43 loc) · 1016 Bytes
/
buildlocaltool.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
@echo off
REM //
REM // ** Build Local Tool 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 %BETOOLS%
REM //
REM //
REM // Validate function arguments.
REM //
if [%~1] equ [] exit /b 1
if [%~2] equ [] exit /b 2
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 tools directory.
REM //
if not [%~3] equ [] (
copy /y "%NTTREE%\%~3" "%BETOOLS%\%~4"
if errorlevel 1 (
echo Failed to copy %~1 to tools directory.
exit /b 2
)
)
exit /b 0