VirtualBox

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

Last change on this file since 42154 was 42154, checked in by vboxsync, 12 years ago

VS2010 preps.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.8 KB
Line 
1# $Id: Makefile.kmk 42154 2012-07-13 23:00:53Z 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 # WinNetConfig - static library with host network interface config API
144 #
145 LIBRARIES.win += WinNetConfig
146 WinNetConfig_TEMPLATE = VBOXR3STATIC
147 WinNetConfig_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
148 WinNetConfig_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
149 WinNetConfig_SOURCES = \
150 win/cfg/VBoxNetCfg.cpp
151 WinNetConfig_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
152
153 #
154 # NetFltInstall
155 #
156 PROGRAMS.win += NetFltInstall
157 NetFltInstall_TEMPLATE = VBOXR3STATIC
158 NetFltInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
159 NetFltInstall_SOURCES = win/tools/VBoxNetFltInstall.cpp
160 NetFltInstall_LIBS = \
161 $(WinNetConfig_1_TARGET) \
162 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
163 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
164 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
165 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
166
167
168 #
169 # NetFltUninstall
170 #
171 PROGRAMS.win += NetFltUninstall
172 NetFltUninstall_TEMPLATE = VBOXR3STATIC
173 NetFltUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
174 NetFltUninstall_SOURCES = win/tools/VBoxNetFltUninstall.cpp
175 NetFltUninstall_LIBS = \
176 $(WinNetConfig_1_TARGET) \
177 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
178 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
179 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
180 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
181
182 #
183 # NetAdpInstall
184 #
185 PROGRAMS.win += NetAdpInstall
186 NetAdpInstall_TEMPLATE = VBOXR3STATIC
187 NetAdpInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
188 NetAdpInstall_SOURCES = win/tools/VBoxNetAdpInstall.cpp
189 NetAdpInstall_LIBS = \
190 $(WinNetConfig_1_TARGET) \
191 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
192 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
193 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
194 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
195
196
197 #
198 # NetAdpUninstall
199 #
200 PROGRAMS.win += NetAdpUninstall
201 NetAdpUninstall_TEMPLATE = VBOXR3STATIC
202 NetAdpUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
203 NetAdpUninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
204 NetAdpUninstall_LIBS = \
205 $(WinNetConfig_1_TARGET) \
206 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
207 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
208 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
209 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
210
211 #
212 # VBoxNetFltNobj
213 #
214 DLLS.win += VBoxNetFltNobj
215 VBoxNetFltNobj_TEMPLATE = VBOXR3STATIC
216 if defined(VBOX_SIGNING_MODE)
217 VBoxNetFltNobj_INSTTYPE = none
218 VBoxNetFltNobj_DEBUG_INSTTYPE = both
219 endif
220 VBoxNetFltNobj_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
221 VBoxNetFltNobj_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
222 VBoxNetFltNobj_INCS = \
223 $(VBoxNetFltNobj_0_OUTDIR)
224 VBoxNetFltNobj_SOURCES = \
225 win/nobj/VBoxNetFltNobj.cpp \
226 win/nobj/VBoxNetFltNobj.def \
227 win/nobj/VBoxNetFltNobj.rc
228 VBoxNetFltNobj_LIBS = \
229 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_VCC_CRT_TYPE).lib
230 #VBoxNetFltNobj_INTERMEDIATES =
231 VBoxNetFltNobj_DEPS = \
232 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
233 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
234 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
235 $(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
236 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb
237 VBoxNetFltNobj_CLEAN = $(VBoxNetFltNobj_DEPS)
238
239 VBOXNETFLT_NOBJ_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
240 $(PATH_SDK_$(VBOX_WINPSDK)_BIN)/Midl.Exe\
241 $(PATH_SDK_$(VBOX_WINPSDK))/Bin/Midl.Exe\
242 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
243 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
244
245$$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
246+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
247+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
248+ $$(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
249+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb: \
250 $(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
251 | $$(dir $$@)
252 $(VBOXNETFLT_NOBJ_IDL) /nologo \
253 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
254 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
255 $(addprefix /I , $(call VBOX_FN_MAKE_WIN_PATH,$(SDK_$(VBOX_WINDDK)_INCS))) \
256 $(call VBOX_FN_MAKE_WIN_PATH,$<)
257
258 #
259 # VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
260 #
261 SYSMODS.win += VBoxNetAdp
262 VBoxNetAdp_TEMPLATE = VBOXR0DRV
263 #VBoxNetAdp_INST = $(INST_VBOXNETADP)
264 if defined(VBOX_SIGNING_MODE)
265 VBoxNetAdp_INSTTYPE = none
266 VBoxNetAdp_DEBUG_INSTTYPE = both
267 endif
268 VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
269 VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
270 VBoxNetAdp_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
271 VBoxNetAdp_SOURCES = \
272 VBoxNetFlt.c \
273 win/drv/VBoxNetFltM-win.cpp \
274 win/drv/VBoxNetFltRt-win.cpp \
275 win/drv/VBoxNetFlt-win.rc
276 VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
277 VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
278 VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
279 VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
280 VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
281 VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
282 VBoxNetAdp_LIBS.win = \
283 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
284 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
285 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
286 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
287 VBoxNetAdp_LIBS = \
288 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
289
290
291 INSTALLS.win += VBoxNetAdp-inf
292 VBoxNetAdp-inf_INST = $(INST_BIN)
293 VBoxNetAdp-inf_MODE = a+r,u+w
294 VBoxNetAdp-inf_SOURCES = \
295 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
296 VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
297 VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
298
299$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
300 $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
301 $(call VBOX_EDIT_INF_FN,$<,$@)
302
303 ifdef VBOX_SIGNING_MODE
304VBoxNetAdp-inf_SOURCES += \
305 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
306 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
307
308$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
309 $(INSTALL) -m 644 $< $(@D)
310
311$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
312 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
313 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
314 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
315 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
316
317 endif # ifdef VBOX_SIGNING_MODE
318
319endif #ifeq ($(KBUILD_TARGET), win)
320
321else if1of ($(KBUILD_TARGET), linux solaris freebsd) ## @todo merge this with the mixed case stuff.
322#
323# vboxnetflt(.ko/.o/) - The lower case driver.
324# Note! On Solaris the name has to be <= 8 chars long.
325#
326 ifdef VBOX_WITH_VBOXDRV
327 SYSMODS += vboxnetflt
328 vboxnetflt_TEMPLATE = VBOXR0DRV
329 vboxnetflt_NAME.solaris = vboxflt
330 vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
331 vboxnetflt_DEFS = IN_RT_R0
332 vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
333 vboxnetflt_INCS.linux := \
334 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
335 vboxnetflt_INCS := \
336 $(PATH_SUB_CURRENT)
337 vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
338 vboxnetflt_LIBS = \
339 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
340 ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
341 #vboxnetflt_LIBS += \
342 # $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
343 vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
344 vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
345 vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
346 vboxnetflt_SOURCES = VBoxNetFlt.c
347 solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
348
349 ifdef VBOX_WITH_NETFLT_CROSSBOW
350 SYSMODS += vboxnetbow
351 vboxnetbow_TEMPLATE = VBOXR0DRV
352 vboxnetbow_NAME = vboxbow
353 vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
354 vboxnetbow_INCS := $(PATH_SUB_CURRENT)
355 vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
356 vboxnetbow_LIBS = \
357 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
358 vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
359 vboxnetbow_SOURCES = VBoxNetFlt.c
360 solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
361 endif # VBOX_WITH_NETFLT_CROSSBOW
362 endif # VBOX_WITH_VBOXDRV
363endif # to be removed.
364
365
366ifeq ($(KBUILD_TARGET),linux)
367 #
368 # Install source files for compilation on Linux.
369 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
370 #
371 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
372 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
373 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
374 VBoxNetFlt-src_SOURCES = \
375 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
376 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
377 VBoxNetFlt-src_EXEC_SOURCES = \
378 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
379 VBoxNetFlt-src_CLEAN = \
380 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
381 $(PATH_TARGET)/VBoxNetFlt-src-1.dep \
382
383 # Scripts needed for building the kernel module.
384
385 includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
386 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
387 $(PATH_SUB_CURRENT)/linux/Makefile \
388 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
389 | $$(dir $$@)
390 $(QUIET)$(RM) -f -- $@
391 ifndef VBOX_WITH_HARDENING
392 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
393 else
394 $(QUIET)$(CP) -f $< $@
395 endif
396 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
397 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
398
399endif # linux
400
401# Gross hack for FreeBSD 7, should figure this out properly
402## @todo Properly generate opt_netgraph.h
403ifeq ($(KBUILD_TARGET),freebsd)
404 vboxnetflt_DEPS.freebsd += $(PATH_OUT)/opt_netgraph.h
405$(PATH_OUT)/opt_netgraph.h:
406 echo > $(PATH_OUT)/opt_netgraph.h
407
408 #
409 # Install source files for compilation on FreeBSD.
410 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
411 #
412 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
413 INSTALLS += VBoxNetFlt-src
414 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
415 VBoxNetFlt-src_SOURCES = \
416 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
417 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
418 VBoxNetFlt-src_CLEAN = \
419 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
420
421 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
422 $(PATH_SUB_CURRENT)/freebsd/Makefile \
423 $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
424 | $$(dir $$@)
425 $(QUIET)$(RM) -f -- $@
426 $(QUIET)$(CP) -f $< $@
427 ifndef VBOX_WITH_HARDENING
428 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@.tmp $@
429 ${QUIET}$(MV) -f $@.tmp $@
430 endif
431 ifndef VBOX_WITH_NETFLT_VIMAGE
432 $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output $@.tmp $@
433 ${QUIET}$(MV) -f $@.tmp $@
434 endif
435endif # freebsd
436
437include $(FILE_KBUILD_SUB_FOOTER)
438
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