VirtualBox

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

Last change on this file since 69691 was 69250, checked in by vboxsync, 7 years ago

HostDrivers: scm updates

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