VirtualBox

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

Last change on this file since 86697 was 84541, checked in by vboxsync, 5 years ago

VBoxNetFlt/Makefile.kmk: midl /I processing fix. bugref:8489

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.5 KB
Line 
1# $Id: Makefile.kmk 84541 2020-05-26 15:52:19Z 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 $$@)
403ifdef KMK_WITH_QUOTING
404 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
405 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
406 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
407 $(qforeachfile unq, incdir, $(SDK_$(VBOX_WINDDK)_INCS),/I $(quote-sh $(incdir))) \
408 $(call VBOX_FN_MAKE_WIN_PATH,$<)
409else
410 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo \
411 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxNetFltNobj_0_OUTDIR)) \
412 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
413 $(foreach incdir, $(SDK_$(VBOX_WINDDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(incdir)) ) \
414 $(call VBOX_FN_MAKE_WIN_PATH,$<)
415endif
416
417 #
418 # VBoxNetAdp.sys - The VirtualBox Adapter miniport driver.
419 #
420 SYSMODS.win += VBoxNetAdp
421 VBoxNetAdp_TEMPLATE = VBOXR0DRV
422 #VBoxNetAdp_INST = $(INST_VBOXNETADP)
423 if defined(VBOX_SIGNING_MODE)
424 VBoxNetAdp_INSTTYPE.win = none
425 VBoxNetAdp_DEBUG_INSTTYPE.win = both
426 endif
427 VBoxNetAdp_DEFS = IN_RT_R0 IN_SUP_STATIC
428 VBoxNetAdp_INCS := $(PATH_SUB_CURRENT)
429 VBoxNetAdp_SDKS = ReorderCompilerIncs $(VBOX_WINDDK_WLH) $(VBOX_WINPSDK)INCS
430 VBoxNetAdp_SOURCES = \
431 VBoxNetFlt.c \
432 win/drv/VBoxNetFltM-win.cpp \
433 win/drv/VBoxNetFltRt-win.cpp \
434 win/drv/VBoxNetFlt-win.rc
435 VBoxNetAdp_DEFS += VBOXNETFLT_STATIC_CONFIG VBOXNETADP
436 VBoxNetAdp_DEFS.win += VBOXNETFLT_NO_PACKET_QUEUE
437 VBoxNetAdp_DEFS += NDIS_MINIPORT_DRIVER NDIS_WDM=1 BINARY_COMPATIBLE=0
438 VBoxNetAdp_DEFS += NDIS50_MINIPORT=1 NDIS50=1
439 VBoxNetAdp_LDFLAGS.win.x86 = -Entry:DriverEntry@8
440 VBoxNetAdp_LDFLAGS.win.amd64 = -Entry:DriverEntry
441 VBoxNetAdp_LIBS.win = \
442 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
443 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib \
444 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ndis.lib \
445 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
446 VBoxNetAdp_LIBS = \
447 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
448
449
450 INSTALLS.win += VBoxNetAdp-inf
451 VBoxNetAdp-inf_TEMPLATE = VBoxR0DrvInfCat
452 VBoxNetAdp-inf_SOURCES = \
453 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
454 VBoxNetAdp-inf_CLEAN = $(VBoxNetAdp-inf_SOURCES)
455 VBoxNetAdp-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetAdpCat.dir
456
457$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf: $(PATH_SUB_CURRENT)/win/drv/VBoxNetAdp.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
458 $(call MSG_GENERATE,VBoxNetAdp-inf,$@,$<)
459 $(call VBOX_EDIT_INF_FN,$<,$@)
460
461 ifdef VBOX_SIGNING_MODE
462VBoxNetAdp-inf_SOURCES += \
463 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
464 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat
465
466$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys: $$(VBoxNetAdp_1_TARGET) | $$(dir $$@)
467 $(INSTALL) -m 644 $< $(@D)
468
469$(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.cat: \
470 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.sys \
471 $(PATH_TARGET)/VBoxNetAdpCat.dir/VBoxNetAdp.inf
472 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
473 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
474
475 endif # ifdef VBOX_SIGNING_MODE
476
477endif #ifeq ($(KBUILD_TARGET), win)
478
479else if1of ($(KBUILD_TARGET), solaris freebsd) ## @todo merge this with the mixed case stuff.
480#
481# vboxnetflt(.ko/.o/) - The lower case driver.
482# Note! On Solaris the name has to be <= 8 chars long.
483# The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels
484#
485 ifdef VBOX_WITH_VBOXDRV
486 SYSMODS += vboxnetflt
487 vboxnetflt_TEMPLATE = VBOXR0DRV
488 vboxnetflt_NAME.solaris = vboxflt
489 vboxnetflt_DEFS = IN_RT_R0
490 vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
491 vboxnetflt_INCS := \
492 $(PATH_SUB_CURRENT)
493 vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv -N misc/ctf
494 vboxnetflt_LIBS = \
495 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
496 ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
497 #vboxnetflt_LIBS += \
498 # $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
499 vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
500 vboxnetflt_SOURCES.freebsd = freebsd/VBoxNetFlt-freebsd.c
501 vboxnetflt_SOURCES = VBoxNetFlt.c
502 solaris/VBoxNetFlt-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
503
504 ifdef VBOX_WITH_NETFLT_CROSSBOW
505 SYSMODS += vboxnetbow
506 vboxnetbow_TEMPLATE = VBOXR0DRV
507 vboxnetbow_NAME = vboxbow
508 vboxnetbow_DEFS = vboxnetflt_DEFS VBOX_WITH_NETFLT_CROSSBOW
509 vboxnetbow_INCS := $(PATH_SUB_CURRENT)
510 vboxnetbow_LDFLAGS += -N drv/vboxdrv -N drv/vnic -N misc/mac -N misc/dls
511 vboxnetbow_LIBS = \
512 $(PATH_STAGE_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
513 vboxnetbow_SOURCES.solaris = solaris/VBoxNetFltBow-solaris.c
514 vboxnetbow_SOURCES = VBoxNetFlt.c
515 solaris/VBoxNetFltBow-solaris.c_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
516 endif # VBOX_WITH_NETFLT_CROSSBOW
517 endif # VBOX_WITH_VBOXDRV
518endif # to be removed.
519
520
521ifeq ($(KBUILD_TARGET),linux)
522 #
523 # Install source files for compilation on Linux.
524 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
525 #
526 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
527 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
528 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
529 VBoxNetFlt-src_SOURCES = \
530 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
531 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
532 VBoxNetFlt-src_CLEAN = \
533 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
534 $(PATH_TARGET)/VBoxNetFlt-src-1.dep \
535
536 # Scripts needed for building the kernel module.
537
538 includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
539 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
540 $(PATH_SUB_CURRENT)/linux/Makefile \
541 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
542 | $$(dir $$@)
543 $(QUIET)$(RM) -f -- $@
544 ifndef VBOX_WITH_HARDENING
545 $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output $@ $<
546 else
547 $(QUIET)$(CP) -f $< $@
548 endif
549 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
550 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
551
552 #
553 # Build test for the linux host kernel modules.
554 #
555 $(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,VBoxNetFlt-src,vboxdrv-src,)
556endif # linux
557
558# Gross hack for FreeBSD 7, should figure this out properly
559## @todo Properly generate opt_netgraph.h
560ifeq ($(KBUILD_TARGET),freebsd)
561 vboxnetflt_DEPS.freebsd += $(PATH_OUT)/opt_netgraph.h
562$(PATH_OUT)/opt_netgraph.h:
563 echo > $(PATH_OUT)/opt_netgraph.h
564
565 #
566 # Install source files for compilation on FreeBSD.
567 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
568 #
569 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
570 INSTALLS += VBoxNetFlt-src
571 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
572 VBoxNetFlt-src_SOURCES = \
573 $(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)) \
574 $(VBoxNetFlt-src_0_OUTDIR)/Makefile
575 VBoxNetFlt-src_CLEAN = \
576 $(VBoxNetFlt-src_0_OUTDIR)/Makefile \
577
578 $$(VBoxNetFlt-src_0_OUTDIR)/Makefile: \
579 $(PATH_SUB_CURRENT)/freebsd/Makefile \
580 $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
581 | $$(dir $$@)
582 $(QUIET)$(RM) -f -- $@
583 $(QUIET)$(CP) -f $< $@
584 ifndef VBOX_WITH_HARDENING
585 $(QUIET)$(SED) -e "s;VBOX_WITH_HARDENING;;g" --output [email protected] $@
586 ${QUIET}$(MV) -f [email protected] $@
587 endif
588 ifndef VBOX_WITH_NETFLT_VIMAGE
589 $(QUIET)$(SED) -e "s;-DVIMAGE;;g" --output [email protected] $@
590 ${QUIET}$(MV) -f [email protected] $@
591 endif
592endif # freebsd
593
594include $(FILE_KBUILD_SUB_FOOTER)
595
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