VirtualBox

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

Last change on this file since 83805 was 83804, checked in by vboxsync, 5 years ago

/Config.kmk,Main,VBoxNetFlt: Move the VBOX_MIDL_REDIRECT tricks up to Config.kmk as it's needed outside Main too (VBoxNetFlt). bugref:8489

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.1 KB
Line 
1# $Id: Makefile.kmk 83804 2020-04-18 22:44:09Z vboxsync $
2## @file
3# Sub-Makefile for the Network Filter Driver (VBoxNetFlt).
4#
5
6#
7# Copyright (C) 2008-2020 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_TEMPLATE = VBoxR0DrvInfCat
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_TEMPLATE = VBoxR0DrvInfCat
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 $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.cat=>VBoxNetLwf-PreW10.cat
211
212# $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwfNobj.dll \
213
214$(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.sys: $$(VBoxNetLwf_1_TARGET) | $$(dir $$@)
215 $(INSTALL) -m 644 $< $(@D)
216
217#$(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwfNobj.dll: $$(VBoxNetLwfNobj_1_TARGET) | $$(dir $$@)
218# $(INSTALL) -m 644 $< $(@D)
219
220$(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.cat: \
221 $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.sys \
222 $(PATH_TARGET)/VBoxNetLwfCat.dir/VBoxNetLwf.inf
223 $(call MSG_TOOL,Inf2Cat,VBoxNetLwf-inf,$@,$<)
224 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
225
226 endif # signing
227
228
229
230 #
231 # WinNetConfig - static library with host network interface config API
232 #
233 LIBRARIES.win += WinNetConfig
234 WinNetConfig_TEMPLATE = VBOXR3STATIC
235 WinNetConfig_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
236 WinNetConfig_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
237 WinNetConfig_INCS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
238 WinNetConfig_SOURCES = win/cfg/VBoxNetCfg.cpp
239
240 #
241 # WinNetConfigNonStatic - static library with host network interface config API
242 #
243 LIBRARIES.win += WinNetConfigNonStatic
244 WinNetConfigNonStatic_TEMPLATE = VBoxR3Dll
245 WinNetConfigNonStatic_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK)
246 WinNetConfigNonStatic_DEFS = _WIN32_WINNT=0x0501 _UNICODE UNICODE
247 WinNetConfigNonStatic_INCS.win = $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
248 WinNetConfigNonStatic_SOURCES = win/cfg/VBoxNetCfg.cpp
249
250 #
251 # NetFltInstall
252 #
253 PROGRAMS.win += NetFltInstall
254 NetFltInstall_TEMPLATE = VBOXR3STATIC
255 NetFltInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
256 NetFltInstall_SOURCES = win/tools/VBoxNetFltInstall.cpp
257 NetFltInstall_LIBS = \
258 $(WinNetConfig_1_TARGET) \
259 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
260 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
261 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
262 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
263
264
265 #
266 # NetFltUninstall
267 #
268 PROGRAMS.win += NetFltUninstall
269 NetFltUninstall_TEMPLATE = VBOXR3STATIC
270 NetFltUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
271 NetFltUninstall_SOURCES = win/tools/VBoxNetFltUninstall.cpp
272 NetFltUninstall_LIBS = \
273 $(WinNetConfig_1_TARGET) \
274 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
275 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
276 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
277 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
278
279 #
280 # NetAdpInstall
281 #
282 PROGRAMS.win += NetAdpInstall
283 NetAdpInstall_TEMPLATE = VBOXR3STATIC
284 NetAdpInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
285 NetAdpInstall_SOURCES = win/tools/VBoxNetAdpInstall.cpp
286 NetAdpInstall_LIBS = \
287 $(WinNetConfig_1_TARGET) \
288 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
289 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
290 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
291 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
292
293
294 #
295 # NetAdpUninstall
296 #
297 PROGRAMS.win += NetAdpUninstall
298 NetAdpUninstall_TEMPLATE = VBOXR3STATIC
299 NetAdpUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
300 NetAdpUninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
301 NetAdpUninstall_LIBS = \
302 $(WinNetConfig_1_TARGET) \
303 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
304 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
305 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
306 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
307
308 #
309 # NetAdp6Install
310 #
311 PROGRAMS.win += NetAdp6Install
312 NetAdp6Install_TEMPLATE = VBOXR3STATIC
313 NetAdp6Install_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
314 NetAdp6Install_SOURCES = win/tools/VBoxNetAdpInstall.cpp
315 NetAdp6Install_DEFS += NDIS60=1
316 NetAdp6Install_LIBS = \
317 $(WinNetConfig_1_TARGET) \
318 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
319 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
320 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
321 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
322
323
324 #
325 # NetAdp6Uninstall
326 #
327 PROGRAMS.win += NetAdp6Uninstall
328 NetAdp6Uninstall_TEMPLATE = VBOXR3STATIC
329 NetAdp6Uninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
330 NetAdp6Uninstall_SOURCES = win/tools/VBoxNetAdpUninstall.cpp
331 NetAdp6Uninstall_DEFS += NDIS60=1
332 NetAdp6Uninstall_LIBS = \
333 $(WinNetConfig_1_TARGET) \
334 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
335 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
336 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
337 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
338
339 #
340 # NetLwfInstall
341 #
342 PROGRAMS.win += NetLwfInstall
343 NetLwfInstall_TEMPLATE = VBOXR3STATIC
344 NetLwfInstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
345 NetLwfInstall_SOURCES = win/tools/VBoxNetLwfInstall.cpp
346 NetLwfInstall_LIBS = \
347 $(WinNetConfig_1_TARGET) \
348 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
349 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
350 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
351 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
352
353
354 #
355 # NetLwfUninstall
356 #
357 PROGRAMS.win += NetLwfUninstall
358 NetLwfUninstall_TEMPLATE = VBOXR3STATIC
359 NetLwfUninstall_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
360 NetLwfUninstall_SOURCES = win/tools/VBoxNetLwfUninstall.cpp
361 NetLwfUninstall_LIBS = \
362 $(WinNetConfig_1_TARGET) \
363 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
364 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
365 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
366 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
367
368 #
369 # VBoxNetFltNobj
370 #
371 DLLS.win += VBoxNetFltNobj
372 VBoxNetFltNobj_TEMPLATE = VBOXR3STATIC
373 if defined(VBOX_SIGNING_MODE)
374 VBoxNetFltNobj_INSTTYPE = none
375 VBoxNetFltNobj_DEBUG_INSTTYPE = both
376 endif
377 VBoxNetFltNobj_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) VBOX_NTDLL
378 VBoxNetFltNobj_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
379 VBoxNetFltNobj_INCS = \
380 $(VBoxNetFltNobj_0_OUTDIR)
381 VBoxNetFltNobj_SOURCES = \
382 win/nobj/VBoxNetFltNobj.cpp \
383 win/nobj/VBoxNetFltNobj.def \
384 win/nobj/VBoxNetFltNobj.rc
385 VBoxNetFltNobj_LIBS = \
386 $(VBOX_LIB_RUNTIME_STATIC)
387 #VBoxNetFltNobj_INTERMEDIATES =
388 VBoxNetFltNobj_DEPS = \
389 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
390 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
391 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
392 $(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
393 $(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb
394 VBoxNetFltNobj_CLEAN = $(VBoxNetFltNobj_DEPS)
395
396$$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_i.c \
397+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT_p.c \
398+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.h \
399+ $$(VBoxNetFltNobj_0_OUTDIR)/dlldata.c \
400+ $$(VBoxNetFltNobj_0_OUTDIR)/VBoxNetFltNobjT.tlb: \
401 $(PATH_SUB_CURRENT)/win/nobj/VBoxNetFltNobjT.idl \
402 | $$(dir $$@)
403 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
404 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
405 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
406 $(addprefix /I , $(call VBOX_FN_MAKE_WIN_PATH,$(SDK_$(VBOX_WINDDK)_INCS))) \
407 $(call VBOX_FN_MAKE_WIN_PATH,$<)
408
409 #
410 # VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
411 #
412 SYSMODS.win += VBoxNetAdp
413 VBoxNetAdp_TEMPLATE = VBOXR0DRV
414 #VBoxNetAdp_INST = $(INST_VBOXNETADP)
415 if defined(VBOX_SIGNING_MODE)
416 VBoxNetAdp_INSTTYPE.win = none
417 VBoxNetAdp_DEBUG_INSTTYPE.win = both
418 endif
419 VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
420 VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
421 VBoxNetAdp_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
422 VBoxNetAdp_SOURCES = \
423 VBoxNetFlt.c \
424 win/drv/VBoxNetFltM-win.cpp \
425 win/drv/VBoxNetFltRt-win.cpp \
426 win/drv/VBoxNetFlt-win.rc
427 VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
428 VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
429 VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
430 VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
431 VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
432 VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
433 VBoxNetAdp_LIBS.win = \
434 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
435 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
436 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
437 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
438 VBoxNetAdp_LIBS = \
439 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
440
441
442 INSTALLS.win += VBoxNetAdp-inf
443 VBoxNetAdp-inf_TEMPLATE = VBoxR0DrvInfCat
444 VBoxNetAdp-inf_SOURCES = \
445 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
446 VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
447 VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
448
449$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
450 $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
451 $(call VBOX_EDIT_INF_FN,$<,$@)
452
453 ifdef VBOX_SIGNING_MODE
454VBoxNetAdp-inf_SOURCES += \
455 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
456 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
457
458$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
459 $(INSTALL) -m 644 $< $(@D)
460
461$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
462 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
463 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
464 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
465 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
466
467 endif # ifdef VBOX_SIGNING_MODE
468
469endif #ifeq ($(KBUILD_TARGET), win)
470
471else if1of ($(KBUILD_TARGET), solaris freebsd) ## @todo merge this with the mixed case stuff.
472#
473# vboxnetflt(.ko/.o/) - The lower case driver.
474# Note! On Solaris the name has to be <= 8 chars long.
475# The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
476#
477 ifdef VBOX_WITH_VBOXDRV
478 SYSMODS += vboxnetflt
479 vboxnetflt_TEMPLATE = VBOXR0DRV
480 vboxnetflt_NAME.solaris = vboxflt
481 vboxnetflt_DEFS = IN_RT_R0
482 vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
483 vboxnetflt_INCS := \
484 $(PATH_SUB_CURRENT)
485 vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
486 vboxnetflt_LIBS = \
487 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
488 ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
489 #vboxnetflt_LIBS += \
490 # $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
491 vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
492 vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
493 vboxnetflt_SOURCES = VBoxNetFlt.c
494 solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
495
496 ifdef VBOX_WITH_NETFLT_CROSSBOW
497 SYSMODS += vboxnetbow
498 vboxnetbow_TEMPLATE = VBOXR0DRV
499 vboxnetbow_NAME = vboxbow
500 vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
501 vboxnetbow_INCS := $(PATH_SUB_CURRENT)
502 vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
503 vboxnetbow_LIBS = \
504 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
505 vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
506 vboxnetbow_SOURCES = VBoxNetFlt.c
507 solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
508 endif # VBOX_WITH_NETFLT_CROSSBOW
509 endif # VBOX_WITH_VBOXDRV
510endif # to be removed.
511
512
513ifeq ($(KBUILD_TARGET),linux)
514 #
515 # Install source files for compilation on Linux.
516 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
517 #
518 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
519 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
520 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
521 VBoxNetFlt-src_SOURCES = \
522 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
523 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
524 VBoxNetFlt-src_CLEAN = \
525 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
526 $(PATH_TARGET)/VBoxNetFlt-src-1.dep \
527
528 # Scripts needed for building the kernel module.
529
530 includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
531 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
532 $(PATH_SUB_CURRENT)/linux/Makefile \
533 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
534 | $$(dir $$@)
535 $(QUIET)$(RM) -f -- $@
536 ifndef VBOX_WITH_HARDENING
537 $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
538 else
539 $(QUIET)$(CP) -f $< $@
540 endif
541 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
542 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
543
544 #
545 # Build test for the linux host kernel modules.
546 #
547 $(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,VBoxNetFlt-src,vboxdrv-src,)
548endif # linux
549
550# Gross hack for FreeBSD 7, should figure this out properly
551## @todo Properly generate opt_netgraph.h
552ifeq ($(KBUILD_TARGET),freebsd)
553 vboxnetflt_DEPS.freebsd += $(PATH_OUT)/opt_netgraph.h
554$(PATH_OUT)/opt_netgraph.h:
555 echo > $(PATH_OUT)/opt_netgraph.h
556
557 #
558 # Install source files for compilation on FreeBSD.
559 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
560 #
561 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
562 INSTALLS += VBoxNetFlt-src
563 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
564 VBoxNetFlt-src_SOURCES = \
565 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
566 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
567 VBoxNetFlt-src_CLEAN = \
568 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
569
570 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
571 $(PATH_SUB_CURRENT)/freebsd/Makefile \
572 $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
573 | $$(dir $$@)
574 $(QUIET)$(RM) -f -- $@
575 $(QUIET)$(CP) -f $< $@
576 ifndef VBOX_WITH_HARDENING
577 $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output [email protected] $@
578 ${QUIET}$(MV) -f [email protected] $@
579 endif
580 ifndef VBOX_WITH_NETFLT_VIMAGE
581 $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output [email protected] $@
582 ${QUIET}$(MV) -f [email protected] $@
583 endif
584endif # freebsd
585
586include $(FILE_KBUILD_SUB_FOOTER)
587
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