VirtualBox

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

Last change on this file since 38082 was 38082, checked in by vboxsync, 13 years ago

*.kmk: Installation/staging adjustments (kBuild 0.2.0 preps).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 15.4 KB
Line 
1# $Id: Makefile.kmk 38082 2011-07-20 14:26:24Z vboxsync $
2## @file
3# Sub-Makefile for the Network Filter Driver (VBoxNetFlt).
4#
5
6#
7# Copyright (C) 2008-2010 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#
26SYSMODS += VBoxNetFlt
27VBoxNetFlt_TEMPLATE = VBOXR0DRV
28VBoxNetFlt_INST = $(INST_VBOXNETFLT)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
29if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win"
30 VBoxNetFlt_NOINST = true
31endif
32VBoxNetFlt_DEFS = IN_RT_R0 IN_SUP_STATIC
33VBoxNetFlt_INCS = .
34VBoxNetFlt_SOURCES.darwin = \
35 darwin/VBoxNetFlt-darwin.cpp
36#VBoxNetFlt_SOURCES.darwin += \
37# darwin/VBoxNetAdapter-darwin.cpp
38VBoxNetFlt_SDKS.win = WINDDKWLH WINPSDKINCS
39VBoxNetFlt_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
47VBoxNetFlt_DEFS.win += WIN9X_COMPAT_SPINLOCK=1
48VBoxNetFlt_DEFS.win += VBOXNETFLT_STATIC_CONFIG
49VBoxNetFlt_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
50VBoxNetFlt_DEFS.win += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
51VBoxNetFlt_DEFS.win += NDIS50_MINIPORT=1 NDIS50=1
52ifdef VBOX_LOOPBACK_USEFLAGS
53 VBoxNetFlt_DEFS.win += VBOX_LOOPBACK_USEFLAGS
54endif
55VBoxNetFlt_SOURCES = VBoxNetFlt.c
56#VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
57VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8
58VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry
59VBoxNetFlt_LIBS.win = \
60 $(PATH_SDK_WINDDKWLH_LIB)/ntoskrnl.lib \
61 $(PATH_SDK_WINDDKWLH_LIB)/hal.lib \
62 $(PATH_SDK_WINDDKWLH_LIB)/ndis.lib \
63 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
64VBoxNetFlt_LIBS = \
65 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
66
67darwin/VBoxNetFlt-darwin.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
68
69
70# Darwin extras.
71ifeq ($(KBUILD_TARGET),darwin)
72INSTALLS += VBoxNetFlt.kext
73VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
74VBoxNetFlt.kext_SOURCES = \
75 $(VBoxNetFlt.kext_0_OUTDIR)/Info.plist
76VBoxNetFlt.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
93INSTALLS.darwin += Scripts-darwin
94Scripts-darwin_INST = $(INST_DIST)
95Scripts-darwin_SOURCES = \
96 darwin/loadnetflt.sh
97endif # darwin
98
99
100ifeq ($(KBUILD_TARGET),win)
101#
102# Windows extras.
103#
104INSTALLS.win += VBoxNetFlt-inf
105VBoxNetFlt-inf_INST = $(INST_BIN)
106VBoxNetFlt-inf_MODE = a+r,u+w
107VBoxNetFlt-inf_SOURCES = \
108 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
109 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
110VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
111VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
112
113$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
114 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
115 $(call VBOX_EDIT_INF_FN,$<,$@)
116
117$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFltM.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
118 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
119 $(call VBOX_EDIT_INF_FN,$<,$@)
120
121 ifdef VBOX_SIGNING_MODE
122VBoxNetFlt-inf_SOURCES += \
123 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
124 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
125 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
126
127$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(VBoxNetFlt_1_TARGET) | $$(dir $$@)
128 $(INSTALL) -m 644 $< $(@D)
129
130$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll: $$(VBoxNetFltNobj_1_TARGET) | $$(dir $$@)
131 $(INSTALL) -m 644 $< $(@D)
132
133$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
134 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
135 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
136 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
137 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
138 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
139 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
140
141 endif # signing
142
143#
144# WinNetConfig - static library with host network interface config API
145#
146LIBRARIES.win += WinNetConfig
147WinNetConfig_TEMPLATE = VBOXR3STATIC
148WinNetConfig_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
149WinNetConfig_SDKS = WINPSDK W2K3DDK
150WinNetConfig_SOURCES = \
151 win/cfg/VBoxNetCfg.cpp
152WinNetConfig_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
153
154#
155# NetFltInstall
156#
157PROGRAMS.win += NetFltInstall
158NetFltInstall_TEMPLATE = VBOXR3STATIC
159NetFltInstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
160NetFltInstall_SOURCES = win/tools/VBoxNetFltInstall.cpp
161NetFltInstall_LIBS = \
162 $(WinNetConfig_1_TARGET) \
163 $(VBoxDrvCfg_1_TARGET) \
164 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
165 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
166
167
168#
169# NetFltUninstall
170#
171PROGRAMS.win += NetFltUninstall
172NetFltUninstall_TEMPLATE = VBOXR3STATIC
173NetFltUninstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
174NetFltUninstall_SOURCES = win/tools/VBoxNetFltUninstall.cpp
175NetFltUninstall_LIBS = \
176 $(WinNetConfig_1_TARGET) \
177 $(VBoxDrvCfg_1_TARGET) \
178 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
179 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
180
181#
182# NetAdpInstall
183#
184PROGRAMS.win += NetAdpInstall
185NetAdpInstall_TEMPLATE = VBOXR3STATIC
186NetAdpInstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
187NetAdpInstall_SOURCES = win/tools/VBoxNetAdpInstall.cpp
188NetAdpInstall_LIBS = \
189 $(WinNetConfig_1_TARGET) \
190 $(VBoxDrvCfg_1_TARGET) \
191 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
192 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
193
194
195#
196# NetAdpUninstall
197#
198PROGRAMS.win += NetAdpUninstall
199NetAdpUninstall_TEMPLATE = VBOXR3STATIC
200NetAdpUninstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
201NetAdpUninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
202NetAdpUninstall_LIBS = \
203 $(WinNetConfig_1_TARGET) \
204 $(VBoxDrvCfg_1_TARGET) \
205 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
206 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
207
208#
209# VBoxNetFltNobj
210#
211DLLS.win += VBoxNetFltNobj
212if defined(VBOX_SIGNING_MODE)
213VBoxNetFltNobj_NOINST = true
214endif
215VBoxNetFltNobj_TEMPLATE = VBOXR3STATIC
216VBoxNetFltNobj_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
217VBoxNetFltNobj_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
218VBoxNetFltNobj_INCS = \
219 $(VBoxNetFltNobj_0_OUTDIR)
220VBoxNetFltNobj_SOURCES = \
221 win/nobj/VBoxNetFltNobj.cpp \
222 win/nobj/VBoxNetFltNobj.def \
223 win/nobj/VBoxNetFltNobj.rc
224VBoxNetFltNobj_LIBS = \
225 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_VCC_CRT_TYPE).lib
226#VBoxNetFltNobj_INTERMEDIATES =
227VBoxNetFltNobj_DEPS = \
228 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
229 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
230 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
231 $(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
232 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb
233VBoxNetFltNobj_CLEAN = $(VBoxNetFltNobj_DEPS)
234
235VBOXNETFLT_NOBJ_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
236 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
237 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
238 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
239 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
240
241$$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
242+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
243+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
244+ $$(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
245+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb: \
246 $(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
247 | $$(dir $$@)
248 $(VBOXNETFLT_NOBJ_IDL) /nologo \
249 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
250 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
251 $(addprefix /I , $(call VBOX_FN_MAKE_WIN_PATH,$(SDK_W2K3DDK_INCS))) \
252 $(call VBOX_FN_MAKE_WIN_PATH,$<)
253
254#
255# VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
256#
257SYSMODS.win += VBoxNetAdp
258VBoxNetAdp_TEMPLATE = VBOXR0DRV
259#VBoxNetAdp_INST = $(INST_VBOXNETADP)
260 if defined(VBOX_SIGNING_MODE)
261VBoxNetAdp_NOINST = true
262 endif
263VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
264VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
265VBoxNetAdp_SDKS = WINDDKWLH WINPSDKINCS
266VBoxNetAdp_SOURCES = \
267 VBoxNetFlt.c \
268 win/drv/VBoxNetFltM-win.cpp \
269 win/drv/VBoxNetFltRt-win.cpp \
270 win/drv/VBoxNetFlt-win.rc
271VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
272VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
273VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
274VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
275VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
276VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
277VBoxNetAdp_LIBS.win = \
278 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
279 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
280 $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
281 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
282VBoxNetAdp_LIBS = \
283 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
284
285
286INSTALLS.win += VBoxNetAdp-inf
287VBoxNetAdp-inf_INST = $(INST_BIN)
288VBoxNetAdp-inf_MODE = a+r,u+w
289VBoxNetAdp-inf_SOURCES = \
290 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
291VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
292VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
293
294$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
295 $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
296 $(call VBOX_EDIT_INF_FN,$<,$@)
297
298 ifdef VBOX_SIGNING_MODE
299VBoxNetAdp-inf_SOURCES += \
300 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
301 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
302
303$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
304 $(INSTALL) -m 644 $< $(@D)
305
306$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
307 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
308 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
309 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
310 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
311
312 endif # ifdef VBOX_SIGNING_MODE
313
314endif #ifeq ($(KBUILD_TARGET), win)
315
316else if1of ($(KBUILD_TARGET), linux solaris freebsd) ## @todo merge this with the mixed case stuff.
317#
318# vboxnetflt(.ko/.o/) - The lower case driver.
319# Note! On Solaris the name has to be <= 8 chars long.
320#
321 ifdef VBOX_WITH_VBOXDRV
322SYSMODS += vboxnetflt
323vboxnetflt_TEMPLATE = VBOXR0DRV
324vboxnetflt_NAME.solaris = vboxflt
325vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
326vboxnetflt_DEFS = IN_RT_R0
327vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
328vboxnetflt_NOINST.linux = true
329vboxnetflt_INCS.linux := \
330 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
331vboxnetflt_INCS := \
332 $(PATH_SUB_CURRENT)
333vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
334vboxnetflt_LIBS = \
335 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
336## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
337#vboxnetflt_LIBS += \
338# $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
339vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
340vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
341vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
342vboxnetflt_SOURCES = VBoxNetFlt.c
343solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
344 ifdef VBOX_WITH_NETFLT_CROSSBOW
345SYSMODS += vboxnetbow
346vboxnetbow_TEMPLATE = VBOXR0DRV
347vboxnetbow_NAME = vboxbow
348vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
349vboxnetbow_DEPS += $(VBOX_SVN_REV_KMK)
350vboxnetbow_INCS := $(PATH_SUB_CURRENT)
351vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
352vboxnetbow_LIBS = \
353 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
354vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
355vboxnetbow_SOURCES = VBoxNetFlt.c
356solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
357 endif # VBOX_WITH_NETFLT_CROSSBOW
358 endif # VBOX_WITH_VBOXDRV
359endif # to be removed.
360
361
362ifeq ($(KBUILD_TARGET),linux)
363 #
364 # Install source files for compilation on Linux.
365 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
366 #
367 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
368 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
369 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
370 VBoxNetFlt-src_MODE = a+r,u+w
371 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
372 VBoxNetFlt-src_SOURCES+= \
373 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
374 VBoxNetFlt-src_CLEAN = \
375 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
376 $(PATH_TARGET)/VBoxNetFlt-src-1.dep
377
378 VBoxNetFlt-sh_INST = bin/src/vboxnetflt/
379 VBoxNetFlt-sh_MODE = a+rx,u+w
380 VBoxNetFlt-sh_SOURCES = \
381 $(VBoxNetFlt-sh_0_OUTDIR)/build_in_tmp \
382 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
383 VBoxNetFlt-sh_CLEAN = $(VBoxNetFlt-sh_0_OUTDIR)/build_in_tmp
384
385
386 includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
387 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
388 $(PATH_SUB_CURRENT)/linux/Makefile \
389 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
390 | $$(dir $$@)
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
399 # Script needed for building the kernel module
400 $$(VBoxNetFlt-sh_0_OUTDIR)/build_in_tmp: \
401 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
402 $(VBOX_VERSION_STAMP) \
403 | $$(dir $$@)
404 $(call MSG_TOOL,Creating,,$@)
405 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetflt;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
406 $(QUIET)chmod 0755 $@
407
408endif # linux
409
410# Gross hack for FreeBSD 7, should figure this out properly
411## @todo Properly generate opt_netgraph.h
412ifeq ($(KBUILD_TARGET),freebsd)
413vboxnetflt_DEPS.freebsd += $(PATH_OUT)/opt_netgraph.h
414$(PATH_OUT)/opt_netgraph.h:
415 echo > $(PATH_OUT)/opt_netgraph.h
416
417 #
418 # Install source files for compilation on FreeBSD.
419 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
420 #
421 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
422 INSTALLS += VBoxNetFlt-src
423 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
424 VBoxNetFlt-src_MODE = a+r,u+w
425 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
426 VBoxNetFlt-src_SOURCES+= \
427 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
428 VBoxNetFlt-src_CLEAN = \
429 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
430
431 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
432 $(PATH_SUB_CURRENT)/freebsd/Makefile \
433 $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
434 | $$(dir $$@)
435 $(QUIET)$(CP) -f $< $@
436 ifndef VBOX_WITH_HARDENING
437 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output [email protected] $@
438 ${QUIET}$(MV) -f [email protected] $@
439 endif
440 ifndef VBOX_WITH_NETFLT_VIMAGE
441 $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output [email protected] $@
442 ${QUIET}$(MV) -f [email protected] $@
443 endif
444endif # freebsd
445
446include $(KBUILD_PATH)/subfooter.kmk
447
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