VirtualBox

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

Last change on this file since 52621 was 52592, checked in by vboxsync, 10 years ago

NetFlt/win: NDIS6: fixes, enable disconnect interface, PM support for NetAdp6, installer helper functions

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