VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk@ 97145

Last change on this file since 97145 was 96572, checked in by vboxsync, 2 years ago

HostDrives,Installer/win: Reworked the windows installer related code for no-CRT mode, where applicable, and changed the XxxxInstall.exe/XxxxUninstall.exe utilities to link against VBoxRT.dll instead of being statically linked. Lot's of cleanup. The change is uncomfortably large, but difficult to detangle these things. bugref:10261

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette