VirtualBox

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

Last change on this file since 56846 was 56846, checked in by vboxsync, 9 years ago

NetFlt/Win: Host IP address notifications (#7661)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.5 KB
Line 
1# $Id: Makefile.kmk 56846 2015-07-07 20:09:37Z vboxsync $
2## @file
3# Sub-Makefile for the Network Filter Driver (VBoxNetFlt).
4#
5
6#
7# Copyright (C) 2008-2015 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_SDK_$(VBOX_WINDDK_WLH)_LIB)/tdi.lib \
64 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
65 VBoxNetFlt_LIBS = \
66 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
67
68 darwin/VBoxNetFlt-darwin.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
69
70
71# Darwin extras.
72ifeq ($(KBUILD_TARGET),darwin)
73 INSTALLS += VBoxNetFlt.kext
74 VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
75 VBoxNetFlt.kext_SOURCES = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/Info.plist
76 VBoxNetFlt.kext_CLEAN = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/Info.plist
77 VBoxNetFlt.kext_BLDDIRS = $(VBoxNetFlt.kext_0_OUTDIR)/Contents/
78
79$$(VBoxNetFlt.kext_0_OUTDIR)/Contents/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 $(evalcall2 VBOX_TEST_SIGN_KEXT,VBoxNetFlt)
94
95 INSTALLS.darwin += Scripts-darwin
96 Scripts-darwin_INST = $(INST_DIST)
97 Scripts-darwin_EXEC_SOURCES = \
98 darwin/loadnetflt.sh
99endif # darwin
100
101
102ifeq ($(KBUILD_TARGET),win)
103 #
104 # Windows extras.
105 #
106 INSTALLS.win += VBoxNetFlt-inf
107 VBoxNetFlt-inf_INST = $(INST_BIN)
108 VBoxNetFlt-inf_SOURCES = \
109 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
110 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
111 VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
112 VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
113
114$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
115 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
116 $(call VBOX_EDIT_INF_FN,$<,$@)
117
118$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetFltM.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
119 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
120 $(call VBOX_EDIT_INF_FN,$<,$@)
121
122 ifdef VBOX_SIGNING_MODE
123VBoxNetFlt-inf_SOURCES += \
124 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
125 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
126 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
127
128$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(VBoxNetFlt_1_TARGET) | $$(dir $$@)
129 $(INSTALL) -m 644 $< $(@D)
130
131$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll: $$(VBoxNetFltNobj_1_TARGET) | $$(dir $$@)
132 $(INSTALL) -m 644 $< $(@D)
133
134$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
135 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
136 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNobj.dll \
137 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
138 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltM.inf
139 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
140 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
141
142 endif # signing
143
144
145 #
146 # VBoxNetLwf.sys - The light-weight filter driver for NDIS6.
147 #
148 SYSMODS += VBoxNetLwf
149 VBoxNetLwf_TEMPLATE = VBOXR0DRV
150 VBoxNetLwf_INST = $(INST_VBOXNETFLT)
151 if defined(VBOX_SIGNING_MODE)
152 VBoxNetLwf_INSTTYPE = none
153 VBoxNetLwf_DEBUG_INSTTYPE = both
154 endif
155 VBoxNetLwf_DEFS = IN_RT_R0 IN_SUP_STATIC
156 VBoxNetLwf_INCS = .
157 VBoxNetLwf_SOURCES = VBoxNetFlt.c VBoxNetFlt.rc
158 VBoxNetLwf_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
159 VBoxNetLwf_SOURCES.win = \
160 win/drv/VBoxNetLwf-win.cpp
161 # with WINDDKWLH the WIN9X_COMPAT_SPINLOCK is needed to avoid inline declaration of KeInitializeSpinLock
162 # otherwise the linker would complain about dumplicate _KeInitializeSpinLock@4 definition
163 # in ntoskrnl.lib and our object files
164 VBoxNetLwf_DEFS.win += WIN9X_COMPAT_SPINLOCK=1 NDISLWF=1 DBG=1
165# VBoxNetLwf_DEFS.win += VBOXNETFLT_STATIC_CONFIG
166# VBoxNetLwf_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
167# VBoxNetLwf_DEFS.win += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
168 VBoxNetLwf_DEFS.win += NDIS60=1
169# ifdef VBOX_LOOPBACK_USEFLAGS
170# VBoxNetLwf_DEFS.win += VBOX_LOOPBACK_USEFLAGS
171# endif
172# VBoxNetLwf_SOURCES = VBoxNetLwf.c
173 VBoxNetLwf_LDFLAGS.win.x86 = -Entry:DriverEntry@8
174 VBoxNetLwf_LDFLAGS.win.amd64 = -Entry:DriverEntry
175 VBoxNetLwf_LIBS.win = \
176 $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ntoskrnl.lib \
177 $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/hal.lib \
178 $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/ndis.lib \
179 $(PATH_SDK_$(VBOX_WINDDK_WLH)_LIB)/netio.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/drv/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
218
219
220 #
221 # WinNetConfig - static library with host network interface config API
222 #
223 LIBRARIES.win += WinNetConfig
224 WinNetConfig_TEMPLATE = VBOXR3STATIC
225 WinNetConfig_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
226 WinNetConfig_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
227 WinNetConfig_SOURCES = \
228 win/cfg/VBoxNetCfg.cpp
229 WinNetConfig_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
230
231 #
232 # NetFltInstall
233 #
234 PROGRAMS.win += NetFltInstall
235 NetFltInstall_TEMPLATE = VBOXR3STATIC
236 NetFltInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
237 NetFltInstall_SOURCES = win/tools/VBoxNetFltInstall.cpp
238 NetFltInstall_LIBS = \
239 $(WinNetConfig_1_TARGET) \
240 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
241 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
242 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
243 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
244
245
246 #
247 # NetFltUninstall
248 #
249 PROGRAMS.win += NetFltUninstall
250 NetFltUninstall_TEMPLATE = VBOXR3STATIC
251 NetFltUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
252 NetFltUninstall_SOURCES = win/tools/VBoxNetFltUninstall.cpp
253 NetFltUninstall_LIBS = \
254 $(WinNetConfig_1_TARGET) \
255 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
256 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
257 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
258 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
259
260 #
261 # NetAdpInstall
262 #
263 PROGRAMS.win += NetAdpInstall
264 NetAdpInstall_TEMPLATE = VBOXR3STATIC
265 NetAdpInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
266 NetAdpInstall_SOURCES = win/tools/VBoxNetAdpInstall.cpp
267 NetAdpInstall_LIBS = \
268 $(WinNetConfig_1_TARGET) \
269 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
270 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
271 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
272 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
273
274
275 #
276 # NetAdpUninstall
277 #
278 PROGRAMS.win += NetAdpUninstall
279 NetAdpUninstall_TEMPLATE = VBOXR3STATIC
280 NetAdpUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
281 NetAdpUninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
282 NetAdpUninstall_LIBS = \
283 $(WinNetConfig_1_TARGET) \
284 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
285 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
286 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
287 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
288
289 #
290 # NetAdp6Install
291 #
292 PROGRAMS.win += NetAdp6Install
293 NetAdp6Install_TEMPLATE = VBOXR3STATIC
294 NetAdp6Install_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
295 NetAdp6Install_SOURCES = win/tools/VBoxNetAdpInstall.cpp
296 NetAdp6Install_DEFS += NDIS60=1
297 NetAdp6Install_LIBS = \
298 $(WinNetConfig_1_TARGET) \
299 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
300 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
301 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
302 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
303
304
305 #
306 # NetAdp6Uninstall
307 #
308 PROGRAMS.win += NetAdp6Uninstall
309 NetAdp6Uninstall_TEMPLATE = VBOXR3STATIC
310 NetAdp6Uninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
311 NetAdp6Uninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
312 NetAdp6Uninstall_DEFS += NDIS60=1
313 NetAdp6Uninstall_LIBS = \
314 $(WinNetConfig_1_TARGET) \
315 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
316 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
317 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
318 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
319
320 #
321 # NetLwfInstall
322 #
323 PROGRAMS.win += NetLwfInstall
324 NetLwfInstall_TEMPLATE = VBOXR3STATIC
325 NetLwfInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
326 NetLwfInstall_SOURCES = win/tools/VBoxNetLwfInstall.cpp
327 NetLwfInstall_LIBS = \
328 $(WinNetConfig_1_TARGET) \
329 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
330 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
331 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
332 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
333
334
335 #
336 # NetLwfUninstall
337 #
338 PROGRAMS.win += NetLwfUninstall
339 NetLwfUninstall_TEMPLATE = VBOXR3STATIC
340 NetLwfUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
341 NetLwfUninstall_SOURCES = win/tools/VBoxNetLwfUninstall.cpp
342 NetLwfUninstall_LIBS = \
343 $(WinNetConfig_1_TARGET) \
344 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
345 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
346 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
347 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
348
349 #
350 # VBoxNetFltNobj
351 #
352 DLLS.win += VBoxNetFltNobj
353 VBoxNetFltNobj_TEMPLATE = VBOXR3STATIC
354 if defined(VBOX_SIGNING_MODE)
355 VBoxNetFltNobj_INSTTYPE = none
356 VBoxNetFltNobj_DEBUG_INSTTYPE = both
357 endif
358 VBoxNetFltNobj_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
359 VBoxNetFltNobj_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
360 VBoxNetFltNobj_INCS = \
361 $(VBoxNetFltNobj_0_OUTDIR)
362 VBoxNetFltNobj_SOURCES = \
363 win/nobj/VBoxNetFltNobj.cpp \
364 win/nobj/VBoxNetFltNobj.def \
365 win/nobj/VBoxNetFltNobj.rc
366 VBoxNetFltNobj_LIBS = \
367 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_VCC_CRT_TYPE).lib
368 #VBoxNetFltNobj_INTERMEDIATES =
369 VBoxNetFltNobj_DEPS = \
370 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
371 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
372 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
373 $(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
374 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb
375 VBoxNetFltNobj_CLEAN = $(VBoxNetFltNobj_DEPS)
376
377$$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
378+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
379+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
380+ $$(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
381+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb: \
382 $(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
383 | $$(dir $$@)
384 $(VBOX_WIN_MIDL) /nologo \
385 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
386 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
387 $(addprefix /I , $(call VBOX_FN_MAKE_WIN_PATH,$(SDK_$(VBOX_WINDDK)_INCS))) \
388 $(call VBOX_FN_MAKE_WIN_PATH,$<)
389
390 #
391 # VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
392 #
393 SYSMODS.win += VBoxNetAdp
394 VBoxNetAdp_TEMPLATE = VBOXR0DRV
395 #VBoxNetAdp_INST = $(INST_VBOXNETADP)
396 if defined(VBOX_SIGNING_MODE)
397 VBoxNetAdp_INSTTYPE.win = none
398 VBoxNetAdp_DEBUG_INSTTYPE.win = both
399 endif
400 VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
401 VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
402 VBoxNetAdp_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
403 VBoxNetAdp_SOURCES = \
404 VBoxNetFlt.c \
405 win/drv/VBoxNetFltM-win.cpp \
406 win/drv/VBoxNetFltRt-win.cpp \
407 win/drv/VBoxNetFlt-win.rc
408 VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
409 VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
410 VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
411 VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
412 VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
413 VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
414 VBoxNetAdp_LIBS.win = \
415 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
416 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
417 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
418 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
419 VBoxNetAdp_LIBS = \
420 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
421
422
423 INSTALLS.win += VBoxNetAdp-inf
424 VBoxNetAdp-inf_INST = $(INST_BIN)
425 VBoxNetAdp-inf_MODE = a+r,u+w
426 VBoxNetAdp-inf_SOURCES = \
427 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
428 VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
429 VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
430
431$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
432 $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
433 $(call VBOX_EDIT_INF_FN,$<,$@)
434
435 ifdef VBOX_SIGNING_MODE
436VBoxNetAdp-inf_SOURCES += \
437 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
438 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
439
440$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
441 $(INSTALL) -m 644 $< $(@D)
442
443$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
444 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
445 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
446 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
447 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
448
449 endif # ifdef VBOX_SIGNING_MODE
450
451endif #ifeq ($(KBUILD_TARGET), win)
452
453else if1of ($(KBUILD_TARGET), linux solaris freebsd) ## @todo merge this with the mixed case stuff.
454#
455# vboxnetflt(.ko/.o/) - The lower case driver.
456# Note! On Solaris the name has to be <= 8 chars long.
457# The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
458#
459 ifdef VBOX_WITH_VBOXDRV
460 SYSMODS += vboxnetflt
461 vboxnetflt_TEMPLATE = VBOXR0DRV
462 vboxnetflt_NAME.solaris = vboxflt
463 vboxnetflt_DEFS.linux = \
464 KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) \
465 KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) \
466 MODULE DEBUG_HASH=2 DEBUG_HASH2=3
467 vboxnetflt_DEFS = IN_RT_R0
468 vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
469 vboxnetflt_INCS.linux := \
470 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
471 vboxnetflt_INCS := \
472 $(PATH_SUB_CURRENT)
473 vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
474 vboxnetflt_LIBS = \
475 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
476 ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
477 #vboxnetflt_LIBS += \
478 # $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
479 vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
480 vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
481 vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
482 vboxnetflt_SOURCES = VBoxNetFlt.c
483 solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
484
485 ifdef VBOX_WITH_NETFLT_CROSSBOW
486 SYSMODS += vboxnetbow
487 vboxnetbow_TEMPLATE = VBOXR0DRV
488 vboxnetbow_NAME = vboxbow
489 vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
490 vboxnetbow_INCS := $(PATH_SUB_CURRENT)
491 vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
492 vboxnetbow_LIBS = \
493 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
494 vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
495 vboxnetbow_SOURCES = VBoxNetFlt.c
496 solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
497 endif # VBOX_WITH_NETFLT_CROSSBOW
498 endif # VBOX_WITH_VBOXDRV
499endif # to be removed.
500
501
502ifeq ($(KBUILD_TARGET),linux)
503 #
504 # Install source files for compilation on Linux.
505 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
506 #
507 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
508 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
509 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
510 VBoxNetFlt-src_SOURCES = \
511 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
512 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
513 VBoxNetFlt-src_EXEC_SOURCES = \
514 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
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