1 | # $Id: Makefile.kmk 93341 2022-01-19 10:53:38Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Network Filter Driver (VBoxNetFlt).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2008-2022 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 | # The contents of this file may alternatively be used under the terms
|
---|
18 | # of the Common Development and Distribution License Version 1.0
|
---|
19 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | # CDDL are applicable instead of those of the GPL.
|
---|
22 | #
|
---|
23 | # You may elect to license modified versions of this file under the
|
---|
24 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | #
|
---|
26 |
|
---|
27 | SUB_DEPTH = ../../../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 |
|
---|
31 | if1of ($(KBUILD_TARGET), darwin win) # this ifeq must go, see @todo around elif
|
---|
32 | #
|
---|
33 | # VBoxNetFlt.sys - The mixed case driver.
|
---|
34 | #
|
---|
35 | SYSMODS += VBoxNetFlt
|
---|
36 | VBoxNetFlt_TEMPLATE = VBOXR0DRV
|
---|
37 | VBoxNetFlt_INST = $(INST_VBOXNETFLT)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
|
---|
38 | VBoxNetFlt_DEBUG_INST.darwin = $(patsubst %/,%,$(INST_VBOXNETFLT))
|
---|
39 | if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win"
|
---|
40 | VBoxNetFlt_INSTTYPE = none
|
---|
41 | VBoxNetFlt_DEBUG_INSTTYPE = both
|
---|
42 | endif
|
---|
43 | VBoxNetFlt_DEFS = IN_RT_R0 IN_SUP_STATIC
|
---|
44 | VBoxNetFlt_INCS = .
|
---|
45 | VBoxNetFlt_SOURCES.darwin = \
|
---|
46 | darwin/VBoxNetFlt-darwin.cpp
|
---|
47 | VBoxNetFlt_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK_INCS)
|
---|
48 | VBoxNetFlt_SOURCES.win = \
|
---|
49 | win/drv/VBoxNetFltP-win.cpp \
|
---|
50 | win/drv/VBoxNetFltM-win.cpp \
|
---|
51 | win/drv/VBoxNetFltRt-win.cpp \
|
---|
52 | win/drv/VBoxNetFlt-win.rc
|
---|
53 | # with WINDDKWLH the WIN9X_COMPAT_SPINLOCK is needed to avoid inline declaration of KeInitializeSpinLock
|
---|
54 | # otherwise the linker would complain about dumplicate _KeInitializeSpinLock@4 definition
|
---|
55 | # in ntoskrnl.lib and our object files
|
---|
56 | VBoxNetFlt_DEFS.win += WIN9X_COMPAT_SPINLOCK=1
|
---|
57 | VBoxNetFlt_DEFS.win += VBOXNETFLT_STATIC_CONFIG
|
---|
58 | VBoxNetFlt_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
|
---|
59 | VBoxNetFlt_DEFS.win += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
|
---|
60 | VBoxNetFlt_DEFS.win += NDIS50_MINIPORT=1 NDIS50=1
|
---|
61 | ifdef VBOX_LOOPBACK_USEFLAGS
|
---|
62 | VBoxNetFlt_DEFS.win += VBOX_LOOPBACK_USEFLAGS
|
---|
63 | endif
|
---|
64 | VBoxNetFlt_SOURCES = VBoxNetFlt.c
|
---|
65 | #VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
|
---|
66 | VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8
|
---|
67 | VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry
|
---|
68 | VBoxNetFlt_LIBS.win = \
|
---|
69 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ntoskrnl.lib \
|
---|
70 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/hal.lib \
|
---|
71 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ndis.lib \
|
---|
72 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/tdi.lib \
|
---|
73 | $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
74 | VBoxNetFlt_LIBS = \
|
---|
75 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
76 |
|
---|
77 | darwin/VBoxNetFlt-darwin.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
78 |
|
---|
79 |
|
---|
80 | # Darwin extras.
|
---|
81 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
82 | INSTALLS += VBoxNetFlt.kext
|
---|
83 | VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
|
---|
84 | VBoxNetFlt.kext_SOURCES = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/Info.plist
|
---|
85 | VBoxNetFlt.kext_CLEAN = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/Info.plist
|
---|
86 | VBoxNetFlt.kext_BLDDIRS = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/
|
---|
87 |
|
---|
88 | $$(VBoxNetFlt.kext_0_OUTDIR)/Contents/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
89 | $(call MSG_GENERATE,VBoxNetFlt,$@,$<)
|
---|
90 | $(QUIET)$(RM) -f $@
|
---|
91 | $(QUIET)$(SED) \
|
---|
92 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
93 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
94 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
95 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
96 | -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
|
---|
97 | -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
|
---|
98 | -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
|
---|
99 | --output $@ \
|
---|
100 | $<
|
---|
101 |
|
---|
102 | $(evalcall2 VBOX_TEST_SIGN_KEXT,VBoxNetFlt)
|
---|
103 |
|
---|
104 | INSTALLS.darwin += Scripts-darwin
|
---|
105 | Scripts-darwin_INST = $(INST_DIST)
|
---|
106 | Scripts-darwin_EXEC_SOURCES = \
|
---|
107 | darwin/loadnetflt.sh
|
---|
108 | endif # darwin
|
---|
109 |
|
---|
110 |
|
---|
111 | ifeq ($(KBUILD_TARGET),win)
|
---|
112 | #
|
---|
113 | # Windows extras.
|
---|
114 | #
|
---|
115 | INSTALLS.win += VBoxNetFlt-inf
|
---|
116 | VBoxNetFlt-inf_TEMPLATE = VBoxR0DrvInfCat
|
---|
117 | VBoxNetFlt-inf_SOURCES = \
|
---|
118 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
119 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
|
---|
120 | VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
|
---|
121 | VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
|
---|
122 |
|
---|
123 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
124 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
125 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
126 |
|
---|
127 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFltM.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
128 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
129 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
130 |
|
---|
131 | ifdef VBOX_SIGNING_MODE
|
---|
132 | VBoxNetFlt-inf_SOURCES += \
|
---|
133 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
|
---|
134 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
|
---|
135 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
|
---|
136 |
|
---|
137 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(VBoxNetFlt_1_TARGET) | $$(dir $$@)
|
---|
138 | $(INSTALL) -m 644 $< $(@D)
|
---|
139 |
|
---|
140 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll: $$(VBoxNetFltNobj_1_TARGET) | $$(dir $$@)
|
---|
141 | $(INSTALL) -m 644 $< $(@D)
|
---|
142 |
|
---|
143 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
|
---|
144 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
|
---|
145 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
|
---|
146 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
147 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
|
---|
148 | $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
|
---|
149 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
150 |
|
---|
151 | endif # signing
|
---|
152 |
|
---|
153 |
|
---|
154 | #
|
---|
155 | # VBoxNetLwf.sys - The light-weight filter driver for NDIS6.
|
---|
156 | #
|
---|
157 | SYSMODS += VBoxNetLwf
|
---|
158 | VBoxNetLwf_TEMPLATE = VBOXR0DRV
|
---|
159 | VBoxNetLwf_INST = $(INST_VBOXNETFLT)
|
---|
160 | if defined(VBOX_SIGNING_MODE)
|
---|
161 | VBoxNetLwf_INSTTYPE = none
|
---|
162 | VBoxNetLwf_DEBUG_INSTTYPE = both
|
---|
163 | endif
|
---|
164 | VBoxNetLwf_DEFS = IN_RT_R0 IN_SUP_STATIC
|
---|
165 | VBoxNetLwf_INCS = .
|
---|
166 | VBoxNetLwf_SOURCES = VBoxNetFlt.c VBoxNetFlt.rc
|
---|
167 | VBoxNetLwf_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK_INCS)
|
---|
168 | VBoxNetLwf_SOURCES.win = \
|
---|
169 | win/drv/VBoxNetLwf-win.cpp
|
---|
170 | # with WINDDKWLH the WIN9X_COMPAT_SPINLOCK is needed to avoid inline declaration of KeInitializeSpinLock
|
---|
171 | # otherwise the linker would complain about dumplicate _KeInitializeSpinLock@4 definition
|
---|
172 | # in ntoskrnl.lib and our object files
|
---|
173 | VBoxNetLwf_DEFS.win += WIN9X_COMPAT_SPINLOCK=1 NDISLWF=1 DBG=1
|
---|
174 | # VBoxNetLwf_DEFS.win += VBOXNETFLT_STATIC_CONFIG
|
---|
175 | # VBoxNetLwf_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
|
---|
176 | # VBoxNetLwf_DEFS.win += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
|
---|
177 | VBoxNetLwf_DEFS.win += NDIS60=1
|
---|
178 | # ifdef VBOX_LOOPBACK_USEFLAGS
|
---|
179 | # VBoxNetLwf_DEFS.win += VBOX_LOOPBACK_USEFLAGS
|
---|
180 | # endif
|
---|
181 | # VBoxNetLwf_SOURCES = VBoxNetLwf.c
|
---|
182 | VBoxNetLwf_LDFLAGS.win.x86 = -Entry:DriverEntry@8
|
---|
183 | VBoxNetLwf_LDFLAGS.win.amd64 = -Entry:DriverEntry
|
---|
184 | VBoxNetLwf_LIBS.win = \
|
---|
185 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ntoskrnl.lib \
|
---|
186 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/hal.lib \
|
---|
187 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ndis.lib \
|
---|
188 | $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/netio.lib \
|
---|
189 | $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
190 | VBoxNetLwf_LIBS = \
|
---|
191 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
192 | #
|
---|
193 | # VBoxNetLwf installation.
|
---|
194 | #
|
---|
195 | INSTALLS.win += VBoxNetLwf-inf
|
---|
196 | VBoxNetLwf-inf_TEMPLATE = VBoxR0DrvInfCat
|
---|
197 | VBoxNetLwf-inf_SOURCES = \
|
---|
198 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.inf
|
---|
199 | VBoxNetLwf-inf_CLEAN = $(VBoxNetLwf-inf_SOURCES)
|
---|
200 | VBoxNetLwf-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetLwfCat.dir
|
---|
201 |
|
---|
202 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetLwf.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
203 | $(call MSG_GENERATE,VBoxNetLwf-inf,$@,$<)
|
---|
204 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
205 |
|
---|
206 | ifdef VBOX_SIGNING_MODE
|
---|
207 | VBoxNetLwf-inf_SOURCES += \
|
---|
208 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.sys \
|
---|
209 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.cat \
|
---|
210 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.cat=>VBoxNetLwf-PreW10.cat
|
---|
211 |
|
---|
212 | # $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwfNobj.dll \
|
---|
213 |
|
---|
214 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.sys: $$(VBoxNetLwf_1_TARGET) | $$(dir $$@)
|
---|
215 | $(INSTALL) -m 644 $< $(@D)
|
---|
216 |
|
---|
217 | #$(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwfNobj.dll: $$(VBoxNetLwfNobj_1_TARGET) | $$(dir $$@)
|
---|
218 | # $(INSTALL) -m 644 $< $(@D)
|
---|
219 |
|
---|
220 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.cat: \
|
---|
221 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.sys \
|
---|
222 | $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.inf
|
---|
223 | $(call MSG_TOOL,Inf2Cat,VBoxNetLwf-inf,$@,$<)
|
---|
224 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
225 |
|
---|
226 | endif # signing
|
---|
227 |
|
---|
228 |
|
---|
229 |
|
---|
230 | #
|
---|
231 | # WinNetConfig - static library with host network interface config API (for the installer)
|
---|
232 | #
|
---|
233 | LIBRARIES.win += WinNetConfig
|
---|
234 | WinNetConfig_TEMPLATE = VBoxR3StaticDllNoAsan
|
---|
235 | WinNetConfig_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
|
---|
236 | WinNetConfig_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
|
---|
237 | WinNetConfig_INCS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
|
---|
238 | WinNetConfig_SOURCES = win/cfg/VBoxNetCfg.cpp
|
---|
239 |
|
---|
240 | #
|
---|
241 | # WinNetConfigNonStatic - static library with host network interface config API
|
---|
242 | #
|
---|
243 | LIBRARIES.win += WinNetConfigNonStatic
|
---|
244 | WinNetConfigNonStatic_TEMPLATE = VBoxR3Dll
|
---|
245 | WinNetConfigNonStatic_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
|
---|
246 | WinNetConfigNonStatic_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
|
---|
247 | WinNetConfigNonStatic_INCS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
|
---|
248 | WinNetConfigNonStatic_SOURCES = win/cfg/VBoxNetCfg.cpp
|
---|
249 |
|
---|
250 |
|
---|
251 | #
|
---|
252 | # Template for NetFltInstall and friends.
|
---|
253 | #
|
---|
254 | TEMPLATE_VBoxNetFltR3 = Template for NetFltInstall, NetFltUninstall, NetAdpInstall, NetAdpUninstall, ++
|
---|
255 | TEMPLATE_VBoxNetFltR3_EXTENDS = VBOXR3STATIC
|
---|
256 | TEMPLATE_VBoxNetFltR3_SDKS = $(TEMPLATE_VBOXR3STATIC_SDKS) ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL VBOX_WIN_NEWDEV
|
---|
257 | TEMPLATE_VBoxNetFltR3_CXXFLAGS = $(TEMPLATE_VBOXR3STATIC_CXXFLAGS) -Gz
|
---|
258 | TEMPLATE_VBoxNetFltR3_CFLAGS = $(TEMPLATE_VBOXR3STATIC_CFLAGS) -Gz
|
---|
259 | TEMPLATE_VBoxNetFltR3_LIBS = $(TEMPLATE_VBOXR3STATIC_LIBS) \
|
---|
260 | $(WinNetConfig_1_TARGET) \
|
---|
261 | $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
|
---|
262 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
|
---|
263 | $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
|
---|
264 |
|
---|
265 | #
|
---|
266 | # NetFltInstall
|
---|
267 | #
|
---|
268 | PROGRAMS.win += NetFltInstall
|
---|
269 | NetFltInstall_TEMPLATE = VBoxNetFltR3
|
---|
270 | NetFltInstall_SOURCES = win/tools/VBoxNetFltInstall.cpp
|
---|
271 |
|
---|
272 | #
|
---|
273 | # NetFltUninstall
|
---|
274 | #
|
---|
275 | PROGRAMS.win += NetFltUninstall
|
---|
276 | NetFltUninstall_TEMPLATE = VBoxNetFltR3
|
---|
277 | NetFltUninstall_SOURCES = win/tools/VBoxNetFltUninstall.cpp
|
---|
278 |
|
---|
279 | #
|
---|
280 | # NetAdpInstall
|
---|
281 | #
|
---|
282 | PROGRAMS.win += NetAdpInstall
|
---|
283 | NetAdpInstall_TEMPLATE = VBoxNetFltR3
|
---|
284 | NetAdpInstall_SOURCES = win/tools/VBoxNetAdpInstall.cpp
|
---|
285 |
|
---|
286 | #
|
---|
287 | # NetAdpUninstall
|
---|
288 | #
|
---|
289 | PROGRAMS.win += NetAdpUninstall
|
---|
290 | NetAdpUninstall_TEMPLATE = VBoxNetFltR3
|
---|
291 | NetAdpUninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
|
---|
292 |
|
---|
293 | #
|
---|
294 | # NetAdp6Install
|
---|
295 | #
|
---|
296 | PROGRAMS.win += NetAdp6Install
|
---|
297 | NetAdp6Install_TEMPLATE = VBoxNetFltR3
|
---|
298 | NetAdp6Install_SOURCES = win/tools/VBoxNetAdpInstall.cpp
|
---|
299 | NetAdp6Install_DEFS = NDIS60=1
|
---|
300 |
|
---|
301 | #
|
---|
302 | # NetAdp6Uninstall
|
---|
303 | #
|
---|
304 | PROGRAMS.win += NetAdp6Uninstall
|
---|
305 | NetAdp6Uninstall_TEMPLATE = VBoxNetFltR3
|
---|
306 | NetAdp6Uninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
|
---|
307 | NetAdp6Uninstall_DEFS = NDIS60=1
|
---|
308 |
|
---|
309 | #
|
---|
310 | # NetLwfInstall
|
---|
311 | #
|
---|
312 | PROGRAMS.win += NetLwfInstall
|
---|
313 | NetLwfInstall_TEMPLATE = VBoxNetFltR3
|
---|
314 | NetLwfInstall_SOURCES = win/tools/VBoxNetLwfInstall.cpp
|
---|
315 |
|
---|
316 | #
|
---|
317 | # NetLwfUninstall
|
---|
318 | #
|
---|
319 | PROGRAMS.win += NetLwfUninstall
|
---|
320 | NetLwfUninstall_TEMPLATE = VBoxNetFltR3
|
---|
321 | NetLwfUninstall_SOURCES = win/tools/VBoxNetLwfUninstall.cpp
|
---|
322 |
|
---|
323 | #
|
---|
324 | # VBoxNetFltNobj
|
---|
325 | #
|
---|
326 | DLLS.win += VBoxNetFltNobj
|
---|
327 | VBoxNetFltNobj_TEMPLATE = VBoxR3StaticDll
|
---|
328 | if defined(VBOX_SIGNING_MODE)
|
---|
329 | VBoxNetFltNobj_INSTTYPE = none
|
---|
330 | VBoxNetFltNobj_DEBUG_INSTTYPE = both
|
---|
331 | endif
|
---|
332 | VBoxNetFltNobj_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
|
---|
333 | VBoxNetFltNobj_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
|
---|
334 | VBoxNetFltNobj_INCS = \
|
---|
335 | $(VBoxNetFltNobj_0_OUTDIR)
|
---|
336 | VBoxNetFltNobj_SOURCES = \
|
---|
337 | win/nobj/VBoxNetFltNobj.cpp \
|
---|
338 | win/nobj/VBoxNetFltNobj.def \
|
---|
339 | win/nobj/VBoxNetFltNobj.rc
|
---|
340 | #VBoxNetFltNobj_INTERMEDIATES =
|
---|
341 | VBoxNetFltNobj_DEPS = \
|
---|
342 | $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
|
---|
343 | $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
|
---|
344 | $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
|
---|
345 | $(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
|
---|
346 | $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb
|
---|
347 | VBoxNetFltNobj_CLEAN = $(VBoxNetFltNobj_DEPS)
|
---|
348 |
|
---|
349 | $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
|
---|
350 | + $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
|
---|
351 | + $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
|
---|
352 | + $$(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
|
---|
353 | + $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb: \
|
---|
354 | $(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
|
---|
355 | | $$(dir $$@)
|
---|
356 | $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
|
---|
357 | /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
|
---|
358 | /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
|
---|
359 | $(qforeachfile unq, incdir, $(SDK_$(VBOX_WINDDK)_INCS) $(SDK_$(VBOX_WINPSDK)_INCS),/I $(quote-sh $(incdir))) \
|
---|
360 | $(call VBOX_FN_MAKE_WIN_PATH,$<)
|
---|
361 | $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h)
|
---|
362 | $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c)
|
---|
363 | $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c)
|
---|
364 |
|
---|
365 |
|
---|
366 | #
|
---|
367 | # VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
|
---|
368 | #
|
---|
369 | SYSMODS.win += VBoxNetAdp
|
---|
370 | VBoxNetAdp_TEMPLATE = VBOXR0DRV
|
---|
371 | #VBoxNetAdp_INST = $(INST_VBOXNETADP)
|
---|
372 | if defined(VBOX_SIGNING_MODE)
|
---|
373 | VBoxNetAdp_INSTTYPE.win = none
|
---|
374 | VBoxNetAdp_DEBUG_INSTTYPE.win = both
|
---|
375 | endif
|
---|
376 | VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
|
---|
377 | VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
|
---|
378 | VBoxNetAdp_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK_INCS)
|
---|
379 | VBoxNetAdp_SOURCES = \
|
---|
380 | VBoxNetFlt.c \
|
---|
381 | win/drv/VBoxNetFltM-win.cpp \
|
---|
382 | win/drv/VBoxNetFltRt-win.cpp \
|
---|
383 | win/drv/VBoxNetFlt-win.rc
|
---|
384 | VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
|
---|
385 | VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
|
---|
386 | VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
|
---|
387 | VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
|
---|
388 | VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
|
---|
389 | VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
|
---|
390 | VBoxNetAdp_LIBS.win = \
|
---|
391 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
|
---|
392 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
|
---|
393 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
|
---|
394 | $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
395 | VBoxNetAdp_LIBS = \
|
---|
396 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
397 |
|
---|
398 |
|
---|
399 | INSTALLS.win += VBoxNetAdp-inf
|
---|
400 | VBoxNetAdp-inf_TEMPLATE = VBoxR0DrvInfCat
|
---|
401 | VBoxNetAdp-inf_SOURCES = \
|
---|
402 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
|
---|
403 | VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
|
---|
404 | VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
|
---|
405 |
|
---|
406 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
407 | $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
|
---|
408 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
409 |
|
---|
410 | ifdef VBOX_SIGNING_MODE
|
---|
411 | VBoxNetAdp-inf_SOURCES += \
|
---|
412 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
|
---|
413 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
|
---|
414 |
|
---|
415 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
|
---|
416 | $(INSTALL) -m 644 $< $(@D)
|
---|
417 |
|
---|
418 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
|
---|
419 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
|
---|
420 | $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
|
---|
421 | $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
|
---|
422 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
423 |
|
---|
424 | endif # ifdef VBOX_SIGNING_MODE
|
---|
425 |
|
---|
426 | endif #ifeq ($(KBUILD_TARGET), win)
|
---|
427 |
|
---|
428 | else if1of ($(KBUILD_TARGET), solaris freebsd) ## @todo merge this with the mixed case stuff.
|
---|
429 | #
|
---|
430 | # vboxnetflt(.ko/.o/) - The lower case driver.
|
---|
431 | # Note! On Solaris the name has to be <= 8 chars long.
|
---|
432 | # The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
|
---|
433 | #
|
---|
434 | ifdef VBOX_WITH_VBOXDRV
|
---|
435 | SYSMODS += vboxnetflt
|
---|
436 | vboxnetflt_TEMPLATE = VBOXR0DRV
|
---|
437 | vboxnetflt_NAME.solaris = vboxflt
|
---|
438 | vboxnetflt_DEFS = IN_RT_R0
|
---|
439 | vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
440 | vboxnetflt_INCS := \
|
---|
441 | $(PATH_SUB_CURRENT)
|
---|
442 | vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
|
---|
443 | vboxnetflt_LIBS = \
|
---|
444 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
445 | ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
|
---|
446 | #vboxnetflt_LIBS += \
|
---|
447 | # $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
448 | vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
|
---|
449 | vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
|
---|
450 | vboxnetflt_SOURCES = VBoxNetFlt.c
|
---|
451 | solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
452 |
|
---|
453 | ifdef VBOX_WITH_NETFLT_CROSSBOW
|
---|
454 | SYSMODS += vboxnetbow
|
---|
455 | vboxnetbow_TEMPLATE = VBOXR0DRV
|
---|
456 | vboxnetbow_NAME = vboxbow
|
---|
457 | vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
|
---|
458 | vboxnetbow_INCS := $(PATH_SUB_CURRENT)
|
---|
459 | vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
|
---|
460 | vboxnetbow_LIBS = \
|
---|
461 | $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
462 | vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
|
---|
463 | vboxnetbow_SOURCES = VBoxNetFlt.c
|
---|
464 | solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
465 | endif # VBOX_WITH_NETFLT_CROSSBOW
|
---|
466 | endif # VBOX_WITH_VBOXDRV
|
---|
467 | endif # to be removed.
|
---|
468 |
|
---|
469 |
|
---|
470 | ifeq ($(KBUILD_TARGET),linux)
|
---|
471 | #
|
---|
472 | # Install source files for compilation on Linux.
|
---|
473 | # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
|
---|
474 | #
|
---|
475 | include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
|
---|
476 | INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
|
---|
477 | VBoxNetFlt-src_INST = bin/src/vboxnetflt/
|
---|
478 | VBoxNetFlt-src_SOURCES = \
|
---|
479 | $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
|
---|
480 | $(VBoxNetFlt-src_0_OUTDIR)/Makefile
|
---|
481 | VBoxNetFlt-src_CLEAN = \
|
---|
482 | $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
|
---|
483 | $(PATH_TARGET)/VBoxNetFlt-src-1.dep \
|
---|
484 |
|
---|
485 | # Scripts needed for building the kernel module.
|
---|
486 |
|
---|
487 | includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
|
---|
488 | $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
|
---|
489 | $(PATH_SUB_CURRENT)/linux/Makefile \
|
---|
490 | $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
491 | | $$(dir $$@)
|
---|
492 | $(QUIET)$(RM) -f -- $@
|
---|
493 | ifndef VBOX_WITH_HARDENING
|
---|
494 | $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
495 | else
|
---|
496 | $(QUIET)$(CP) -f $< $@
|
---|
497 | endif
|
---|
498 | %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
|
---|
499 | %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
|
---|
500 |
|
---|
501 | #
|
---|
502 | # Build test for the linux host kernel modules.
|
---|
503 | #
|
---|
504 | $(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,VBoxNetFlt-src,vboxdrv-src,)
|
---|
505 | endif # linux
|
---|
506 |
|
---|
507 | # Gross hack for FreeBSD 7, should figure this out properly
|
---|
508 | ## @todo Properly generate opt_netgraph.h
|
---|
509 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
510 | vboxnetflt_DEPS.freebsd += $(PATH_OUT)/opt_netgraph.h
|
---|
511 | $(PATH_OUT)/opt_netgraph.h:
|
---|
512 | echo > $(PATH_OUT)/opt_netgraph.h
|
---|
513 |
|
---|
514 | #
|
---|
515 | # Install source files for compilation on FreeBSD.
|
---|
516 | # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
|
---|
517 | #
|
---|
518 | include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
|
---|
519 | INSTALLS += VBoxNetFlt-src
|
---|
520 | VBoxNetFlt-src_INST = bin/src/vboxnetflt/
|
---|
521 | VBoxNetFlt-src_SOURCES = \
|
---|
522 | $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
|
---|
523 | $(VBoxNetFlt-src_0_OUTDIR)/Makefile
|
---|
524 | VBoxNetFlt-src_CLEAN = \
|
---|
525 | $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
|
---|
526 |
|
---|
527 | $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
|
---|
528 | $(PATH_SUB_CURRENT)/freebsd/Makefile \
|
---|
529 | $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
530 | | $$(dir $$@)
|
---|
531 | $(QUIET)$(RM) -f -- $@
|
---|
532 | $(QUIET)$(CP) -f $< $@
|
---|
533 | ifndef VBOX_WITH_HARDENING
|
---|
534 | $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@.tmp $@
|
---|
535 | ${QUIET}$(MV) -f $@.tmp $@
|
---|
536 | endif
|
---|
537 | ifndef VBOX_WITH_NETFLT_VIMAGE
|
---|
538 | $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
|
---|
539 | ${QUIET}$(MV) -f $@.tmp $@
|
---|
540 | endif
|
---|
541 | endif # freebsd
|
---|
542 |
|
---|
543 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
544 |
|
---|