VirtualBox

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

Last change on this file since 94887 was 93509, checked in by vboxsync, 3 years ago

HostDrivers/VBoxNet*: Respect VBOX_WITH_VBOXDRV and don't install anything if undefined. bugref:9898

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