VirtualBox

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

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

NetFlt/win: VBoxNetFltNf-win.* removed, uppercased WinNetCfg lib public function names

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 6.7 KB
 
1# $Id: Makefile.kmk 13854 2008-11-05 13:05:58Z 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_SOURCES.win += win/VBoxNetFltMp-win.c
39endif
40VBoxNetFlt_SOURCES = VBoxNetFlt.c
41VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
42VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8
43VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry
44VBoxNetFlt_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm
45VBoxNetFlt_DEFS.win.amd64 += RT_WITH_W64_UNWIND_HACK
46VBoxNetFlt_LIBS.win = \
47 $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
48 $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
49 $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
50 $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
51VBoxNetFlt_LIBS = \
52 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
53
54
55# Darwin extras.
56ifeq ($(KBUILD_TARGET),darwin)
57INSTALLS += VBoxNetFlt.kext
58VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
59VBoxNetFlt.kext_SOURCES = \
60 $(PATH_VBoxNetFlt.kext)/Info.plist
61VBoxNetFlt.kext_CLEAN = \
62 $(PATH_VBoxNetFlt.kext)/Info.plist
63
64$$(PATH_VBoxNetFlt.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
65 $(call MSG_GENERATE,VBoxNetFlt,$@,$<)
66 $(xQUIET)$(RM) -f $@
67 $(xQUIET)$(SED) \
68 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
69 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
70 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
71 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
72 --output $@ \
73 $<
74
75INSTALLS.darwin += Scripts-darwin
76Scripts-darwin_INST = $(INST_DIST)
77Scripts-darwin_SOURCES = \
78 darwin/loadnetflt.sh
79endif # darwin
80
81
82# Windows extras.
83INSTALLS.win += VBoxNetFlt-inf
84VBoxNetFlt-inf_INST = $(INST_BIN)
85VBoxNetFlt-inf_MODE = a+r,u+w
86VBoxNetFlt-inf_SOURCES = \
87 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
88 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf
89VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
90VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
91
92$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
93 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
94 $(call VBOX_EDIT_INF_FN,$<,$@)
95
96$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
97 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
98 $(call VBOX_EDIT_INF_FN,$<,$@)
99
100 ifdef VBOX_SIGNING_MODE
101VBoxNetFlt-inf_SOURCES += \
102 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
103 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
104
105$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(dir $$@)
106 $(INSTALL) -m 644 $< $(@D)
107
108$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
109 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
110 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf \
111 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
112 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
113 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
114 endif # signing
115
116#
117# WinNetConfig - static library with host network interface config API
118#
119LIBRARIES.win += WinNetConfig
120WinNetConfig_TEMPLATE = VBOXR3STATIC
121WinNetConfig_DEFS = _WIN32_WINNT=0x0500 _UNICODE UNICODE
122WinNetConfig_SDKS = WINPSDK W2K3DDK
123WinNetConfig_SOURCES = \
124 win/WinNetConfig.cpp
125
126else if1of ($(KBUILD_TARGET), linux solaris)
127#
128# vboxnetflt(.ko/.o/) - The lower case driver.
129# Note! On Solaris the name has to be <= 8 chars long.
130#
131SYSMODS += vboxnetflt
132vboxnetflt_TEMPLATE = VBOXR0DRV
133vboxnetflt_NAME.solaris = vboxflt
134vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
135vboxnetflt_DEFS = IN_RT_R0
136vboxnetflt_DEFS.solaris += VBOX_SVN_REV=$(VBOX_SVN_REV)
137vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
138vboxnetflt_INCS.linux := \
139 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
140vboxnetflt_INCS := \
141 $(PATH_SUB_CURRENT)
142vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv
143ifdef VBOXNETFLT_SOLARIS_USE_NETINFO
144 vboxnetflt_DEFS.solaris += VBOXNETFLT_SOLARIS_USE_NETINFO
145 vboxnetflt_LDFLAGS.solaris += -N misc/neti
146endif
147vboxnetflt_LIBS = \
148 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
149## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
150#vboxnetflt_LIBS += \
151# $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
152vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
153vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
154vboxnetflt_SOURCES = VBoxNetFlt.c
155
156endif
157
158ifeq ($(KBUILD_TARGET),linux)
159 #
160 # Install source files for compliation on Linux.
161 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
162 #
163 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
164 INSTALLS += VBoxNetFlt-src
165 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
166 VBoxNetFlt-src_MODE = a+r,u+w
167 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
168 VBoxNetFlt-src_SOURCES+= $(PATH_VBoxNetFlt-src)/Makefile
169 VBoxNetFlt-src_CLEAN = $(PATH_VBoxNetFlt-src)/Makefile
170
171includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
172$$(PATH_VBoxNetFlt-src)/Makefile: \
173 $(PATH_SUB_CURRENT)/linux/Makefile \
174 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
175 | $$(dir $$@)
176ifndef VBOX_WITH_HARDENING
177 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
178else
179 $(QUIET)$(CP) -f $< $@
180endif
181 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
182 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
183
184## Scripts needed for building the kernel modules
185### @todo generate these else where and move them from OTHERS to vboxmod-bin (which btw installs NOBIN files contrary to its name).
186#
187#$(PATH_BIN)/src/build_in_tmp: \
188# $(PATH_SUB_CURRENT)/linux/build_in_tmp \
189# $(VBOX_VERSION_STAMP)
190# $(call MSG_TOOL,Creating,,$@)
191# $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxdrv;g" --output $@ $<
192# $(QUIET)chmod 0755 $@
193#
194#$(PATH_BIN)/src/dkms.conf: \
195# $(PATH_SUB_CURRENT)/linux/dkms.conf \
196# $(VBOX_VERSION_STAMP)
197# $(call MSG_TOOL,Creating,,$@)
198# $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
199
200endif # linux
201
202include $(KBUILD_PATH)/subfooter.kmk
203
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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