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