forked from nmap/npcap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CompileDriver.bat
120 lines (84 loc) · 3.04 KB
/
CompileDriver.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
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
@echo off
if "%_BUILDARCH%"=="x86" goto x86_build
if "%_BUILDARCH%"=="AMD64" goto amd64_build
if "%_BUILDARCH%"=="IA64" goto ia64_build
if "%_BUILDARCH%"=="" goto nt4_build
echo ******************************************************
echo ERROR: unknown build architecture (%_BUILDARCH%)
echo ******************************************************
goto end
:x86_build
echo ******************************************************
echo * Compiling the driver for Windows NT5.x 32 bit *
echo ******************************************************
mkdir driver\bin 2> nul
mkdir driver\bin\2k 2> nul
rem mkdir driver\bin\2k\%DDKBUILDENV% 2> nul
set TARGETPATH=bin\2k
set NPF_C_DEFINES=-DNDIS50
rem ** enable the following line to enable the TME extensions **
rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c
rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT
set NPF_JIT_FILES=jitter.c
prefast build -cefw
set TARGETPATH=
set NPF_C_DEFINES=
set NPF_TME_FILES=
set NPF_JIT_FILES=
goto end
:amd64_build
echo *******************************************************
echo * Compiling the driver for Windows NT5.x x64 (AMD64) *
echo *******************************************************
mkdir driver\bin 2> nul
mkdir driver\bin\xp 2> nul
set TARGETPATH=bin\xp
set NPF_C_DEFINES=-DNDIS50
rem
rem The TME extensions and the JIT is not supported on x64, at the moment
rem
set NPF_TME_FILES=
set NPF_JIT_FILES=
prefast build -cefw
set TARGETPATH=
set NPF_C_DEFINES=
set NPF_TME_FILES=
set NPF_JIT_FILES=
goto end
:ia64_build
echo *******************************************************
echo * Compiling the driver for Windows NT5.x IA64 *
echo *******************************************************
echo ..
echo ERROR: IA64 is not supported by WinPcap.
echo ..
goto end
:nt4_build
echo *******************************************************
echo * Compiling the driver for Windows NT4 *
echo * *
echo * NOTE: the script didn't detect the actual BUILD env *
echo * so it assumed NT4 DDK. *
echo *******************************************************
mkdir driver\bin 2> nul
mkdir driver\bin\NT4\i386 2> nul
mkdir driver\bin\NT4\i386\free 2> nul
mkdir driver\bin\NT4\i386\checked 2> nul
set TARGETPREFIX=NT4\
set NPF_C_DEFINES=-DNDIS30 -D__NPF_NT4__
rem ** enable the following line to enable the TME extensions **
rem set NPF_TME_FILES=tme.c count_packets.c tcp_session.c functions.c bucket_lookup.c normal_lookup.c win_bpf_filter_init.c
rem set NPF_C_DEFINES=%NPF_C_DEFINES% -DHAVE_BUGGY_TME_SUPPORT
set NPF_JIT_FILES=jitter.c
set TARGETSUFFIX=\NT4
if NOT "%NPF_COMPILED%" == "1" (
set Include=%BASEDIR%\src\network\inc;%BASEDIR%\inc;%Include%
set NPF_COMPILED=1
)
build -cefw
set TARGETSUFFIX=
set NPF_C_DEFINES=
set NPF_TME_FILES=
set NPF_JIT_FILES=
goto end
:end