forked from nmap/npcap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_sdk.bat
36 lines (27 loc) · 913 Bytes
/
build_sdk.bat
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
@echo off
for /F tokens^=3^,4^ delims^=^"^ ^ %%A in (version.h) do if "%%A" == "NPCAP_SDK_VERSION" set SDK_VER=%%B
if "%SDK_VER%" == "" goto :fail
set SDKFILENAME=npcap-sdk-%SDK_VER%.zip
if "%2"== "" ( rd /s/q ./npcap-sdk 2>nul >nul) else ( rd /s /q "%2" 2>nul >nul)
SET TOPSRCDIR=%cd%
rem Must build Npcap in order to have the lib files available (and to ensure it builds correctly!)
cd installer
call Build.bat
cd %TOPSRCDIR%
rem Requires Cygwin to provide make.exe
call create_include.bat %1 %2
call create_lib.bat %1 %2 || goto :fail
call create_examples.bat %1 %2
rem Requires xsltproc and Docbook XSL stylesheets
call create_docs.bat %1 %2
del %SDKFILENAME%
copy SDK_README.md .\npcap-sdk\SDK_README.md
xcopy /v /Y "SDK_README.md" .\npcap-sdk\
cd .\npcap-sdk
"C:\Program Files\7-Zip\7z.exe" a ..\%SDKFILENAME% .
PAUSE
exit /b
:fail
echo Failed!
pause
exit /b 1