VirtualBox

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

最後變更 在這個檔案從14852是 14738,由 vboxsync 提交於 16 年 前

VBoxNetFlt/Makefile.kmk: oops

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 9.7 KB
 
1# $Id: Makefile.kmk 14738 2008-11-27 19:11:39Z vboxsync $
2## @file
3# Sub-Makefile for the Network Filter Driver (VBoxNetFlt).
4#
5
6#
7# Copyright (C) 2008 Sun Microsystems, Inc.
8#
9# Sun Microsystems, Inc. confidential
10# All rights reserved
11#
12
13SUB_DEPTH = ../../../..
14include $(KBUILD_PATH)/subheader.kmk
15
16
17if1of ($(KBUILD_TARGET), darwin win)
18#
19# VBoxNetFlt.sys - The mixed case driver.
20#
21SYSMODS += VBoxNetFlt
22VBoxNetFlt_TEMPLATE = VBOXR0DRV
23VBoxNetFlt_INST = $(INST_VBOXNETFLT)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
24if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win"
25 VBoxNetFlt_NOINST = true
26endif
27VBoxNetFlt_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
28VBoxNetFlt_SDKS.win = W2K3DDK WINPSDKINCS
29VBoxNetFlt_INCS := $(PATH_SUB_CURRENT)
30VBoxNetFlt_SOURCES.darwin = darwin/VBoxNetFlt-darwin.cpp
31VBoxNetFlt_SOURCES.win = \
32 win/VBoxNetFlt-win.c \
33 win/VBoxNetFltPt-win.c \
34 win/VBoxNetFlt-win.rc
35ifdef VBOX_NETFLT_ONDEMAND_BIND
36 VBoxNetFlt_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
37else
38 VBoxNetFlt_DEFS.win += VBOXNETFLT_STATIC_CONFIG
39 VBoxNetFlt_SOURCES.win += win/VBoxNetFltMp-win.c
40endif
41VBoxNetFlt_SOURCES = VBoxNetFlt.c
42VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
43VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8
44VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry
45VBoxNetFlt_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm
46VBoxNetFlt_DEFS.win.amd64 += RT_WITH_W64_UNWIND_HACK
47VBoxNetFlt_LIBS.win = \
48 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
49 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
50 $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
51 $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
52VBoxNetFlt_LIBS = \
53 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
54
55
56# Darwin extras.
57ifeq ($(KBUILD_TARGET),darwin)
58INSTALLS += VBoxNetFlt.kext
59VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
60VBoxNetFlt.kext_SOURCES = \
61 $(PATH_VBoxNetFlt.kext)/Info.plist
62VBoxNetFlt.kext_CLEAN = \
63 $(PATH_VBoxNetFlt.kext)/Info.plist
64
65$$(PATH_VBoxNetFlt.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
66 $(call MSG_GENERATE,VBoxNetFlt,$@,$<)
67 $(xQUIET)$(RM) -f $@
68 $(xQUIET)$(SED) \
69 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
70 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
71 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
72 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
73 --output $@ \
74 $<
75
76INSTALLS.darwin += Scripts-darwin
77Scripts-darwin_INST = $(INST_DIST)
78Scripts-darwin_SOURCES = \
79 darwin/loadnetflt.sh
80endif # darwin
81
82
83ifeq ($(KBUILD_TARGET),win)
84#
85# Windows extras.
86#
87INSTALLS.win += VBoxNetFlt-inf
88VBoxNetFlt-inf_INST = $(INST_BIN)
89VBoxNetFlt-inf_MODE = a+r,u+w
90VBoxNetFlt-inf_SOURCES = \
91 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
92 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf
93VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
94VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
95
96$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
97 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
98 $(call VBOX_EDIT_INF_FN,$<,$@)
99
100$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
101 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
102 $(call VBOX_EDIT_INF_FN,$<,$@)
103
104 ifdef VBOX_SIGNING_MODE
105VBoxNetFlt-inf_SOURCES += \
106 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
107 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
108
109$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(dir $$@)
110 $(INSTALL) -m 644 $< $(@D)
111
112$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNotify.dll: $$(TARGET_VBoxNetFltNotify) | $$(dir $$@)
113 $(INSTALL) -m 644 $< $(@D)
114
115$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
116 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
117 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFltNotify.dll \
118 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
119 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf \
120 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
121 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
122 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
123 endif # signing
124
125#
126# WinNetConfig - static library with host network interface config API
127#
128LIBRARIES.win += WinNetConfig
129WinNetConfig_TEMPLATE = VBOXR3STATIC
130WinNetConfig_DEFS = _WIN32_WINNT=0x0500 _UNICODE UNICODE
131WinNetConfig_SDKS = WINPSDK W2K3DDK
132WinNetConfig_SOURCES = \
133 win/WinNetConfig.cpp
134
135
136#
137# NetFltInstall
138#
139PROGRAMS.win += NetFltInstall
140NetFltInstall_TEMPLATE = VBOXR3STATIC
141NetFltInstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
142NetFltInstall_SOURCES = win/NetFltInstall.cpp
143NetFltInstall_LIBS = $(PATH_LIB)/WinNetConfig.lib
144
145
146#
147# NetFltUninstall
148#
149PROGRAMS.win += NetFltUninstall
150NetFltUninstall_TEMPLATE = VBOXR3STATIC
151NetFltUninstall_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
152NetFltUninstall_SOURCES = win/NetFltUninstall.cpp
153NetFltUninstall_LIBS = $(PATH_LIB)/WinNetConfig.lib
154
155
156#
157# VBoxNetFltNotify
158#
159DLLS.win += VBoxNetFltNotify
160VBoxNetFltNotify_TEMPLATE = VBOXR3STATIC
161VBoxNetFltNotify_SDKS = WINPSDK W2K3DDK VBOX_NTDLL
162VBoxNetFltNotify_DEFS = _WIN32_WINNT=0x0500 WIN32 _ATL_STATIC_REGISTRY
163VBoxNetFltNotify_INCS = \
164 $(PATH_VBoxNetFltNotify)
165VBoxNetFltNotify_SOURCES = \
166 win/notifyobj/VBoxNetFltNotify.cpp \
167 win/notifyobj/VBoxNetFltNotify.def \
168 win/notifyobj/VBoxNetFltNotify.rc
169VBoxNetFltNotify_LIBS = \
170 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
171#VBoxNetFltNotify_INTERMEDIATES =
172VBoxNetFltNotify_DEPS = \
173 $(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn_i.c \
174 $(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn_p.c \
175 $(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn.h \
176 $(PATH_VBoxNetFltNotify)/dlldata.c \
177 $(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn.tlb
178VBoxNetFltNotify_CLEAN = $(VBoxNetFltNotify_DEPS)
179
180VBOXNETFLT_NOTIFY_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
181 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
182 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
183 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
184 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
185
186$$(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn_i.c \
187+ $$(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn_p.c \
188+ $$(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn.h \
189+ $$(PATH_VBoxNetFltNotify)/dlldata.c \
190+ $$(PATH_VBoxNetFltNotify)/VBoxNetFltNotifyn.tlb: \
191 $(PATH_SUB_CURRENT)/win/notifyobj/VBoxNetFltNotifyn.idl \
192 | $$(dir $$@)
193 $(VBOXNETFLT_NOTIFY_IDL) /nologo \
194 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxNetFltNotify)) \
195 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
196 $(addprefix /I , $(call VBOX_FN_MAKE_WIN_PATH,$(SDK_W2K3DDK_INCS))) \
197 $(call VBOX_FN_MAKE_WIN_PATH,$<)
198endif #ifeq ($(KBUILD_TARGET), win)
199
200else if1of ($(KBUILD_TARGET), linux solaris) ## @todo merge this with the mixed case stuff.
201#
202# vboxnetflt(.ko/.o/) - The lower case driver.
203# Note! On Solaris the name has to be <= 8 chars long.
204#
205SYSMODS += vboxnetflt
206vboxnetflt_TEMPLATE = VBOXR0DRV
207vboxnetflt_NAME.solaris = vboxflt
208vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
209vboxnetflt_DEFS = IN_RT_R0
210vboxnetflt_DEFS.solaris += VBOX_SVN_REV=$(VBOX_SVN_REV)
211vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
212vboxnetflt_NOINST.linux = true
213vboxnetflt_INCS.linux := \
214 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
215vboxnetflt_INCS := \
216 $(PATH_SUB_CURRENT)
217vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv
218ifdef VBOXNETFLT_SOLARIS_USE_NETINFO
219 vboxnetflt_DEFS.solaris += VBOXNETFLT_SOLARIS_USE_NETINFO
220 vboxnetflt_LDFLAGS.solaris += -N misc/neti
221endif
222vboxnetflt_LIBS = \
223 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
224## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
225#vboxnetflt_LIBS += \
226# $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
227vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
228vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
229vboxnetflt_SOURCES = VBoxNetFlt.c
230
231endif
232
233ifeq ($(KBUILD_TARGET),linux)
234 #
235 # Install source files for compliation on Linux.
236 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
237 #
238 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
239 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
240 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
241 VBoxNetFlt-src_MODE = a+r,u+w
242 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
243 VBoxNetFlt-src_SOURCES+= \
244 $(if $(VBOX_OSE),,\
245 $(PATH_VBoxNetFlt-src)/dkms.conf \
246 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers) \
247 $(PATH_VBoxNetFlt-src)/Makefile
248 VBoxNetFlt-src_CLEAN = \
249 $(PATH_VBoxNetFlt-src)/dkms.conf \
250 $(PATH_VBoxNetFlt-src)/Makefile
251
252 VBoxNetFlt-sh_INST = bin/src/vboxnetflt/
253 VBoxNetFlt-sh_MODE = a+rx,u+w
254 VBoxNetFlt-sh_SOURCES = $(PATH_VBoxNetFlt-sh)/build_in_tmp
255 VBoxNetFlt-sh_CLEAN = $(PATH_VBoxNetFlt-sh)/build_in_tmp
256
257
258includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
259$$(PATH_VBoxNetFlt-src)/Makefile: \
260 $(PATH_SUB_CURRENT)/linux/Makefile \
261 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
262 | $$(dir $$@)
263ifndef VBOX_WITH_HARDENING
264 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
265else
266 $(QUIET)$(CP) -f $< $@
267endif
268 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
269 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
270
271## Scripts needed for building the kernel modules
272
273$$(PATH_VBoxNetFlt-sh)/build_in_tmp: \
274 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
275 $(VBOX_VERSION_STAMP) \
276 | $$(dir $$@)
277 $(call MSG_TOOL,Creating,,$@)
278 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetflt;g" --output $@ $<
279 $(QUIET)chmod 0755 $@
280
281$$(PATH_VBoxNetFlt-src)/dkms.conf: \
282 $(PATH_SUB_CURRENT)/linux/dkms.conf \
283 $(VBOX_VERSION_STAMP) \
284 | $$(dir $$@)
285 $(call MSG_TOOL,Creating,,$@)
286 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
287
288endif # linux
289
290include $(KBUILD_PATH)/subfooter.kmk
291
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette