VirtualBox

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

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

added vboxnetflt to the installer + some cleanup

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 7.0 KB
 
1# $Id: Makefile.kmk 14015 2008-11-10 13:57:45Z 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_NOINST = true
139vboxnetflt_INCS.linux := \
140 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
141vboxnetflt_INCS := \
142 $(PATH_SUB_CURRENT)
143vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv
144ifdef VBOXNETFLT_SOLARIS_USE_NETINFO
145 vboxnetflt_DEFS.solaris += VBOXNETFLT_SOLARIS_USE_NETINFO
146 vboxnetflt_LDFLAGS.solaris += -N misc/neti
147endif
148vboxnetflt_LIBS = \
149 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
150## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
151#vboxnetflt_LIBS += \
152# $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
153vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
154vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
155vboxnetflt_SOURCES = VBoxNetFlt.c
156
157endif
158
159ifeq ($(KBUILD_TARGET),linux)
160 #
161 # Install source files for compliation on Linux.
162 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
163 #
164 include $(PATH_SUB_CURRENT)/linux/files_vboxnetflt
165 INSTALLS += VBoxNetFlt-src VBoxNetFlt-sh
166 VBoxNetFlt-src_INST = bin/src/vboxnetflt/
167 VBoxNetFlt-src_MODE = a+r,u+w
168 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
169 VBoxNetFlt-src_SOURCES+= \
170 $(if $(VBOX_OSE),,$(PATH_VBoxNetFlt-src)/dkms.conf) \
171 $(PATH_VBoxNetFlt-src)/Makefile
172 VBoxNetFlt-src_CLEAN = \
173 $(PATH_VBoxNetFlt-src)/dkms.conf \
174 $(PATH_VBoxNetFlt-src)/Makefile
175
176 VBoxNetFlt-sh_INST = bin/src/vboxnetflt/
177 VBoxNetFlt-sh_MODE = a+rx,u+w
178 VBoxNetFlt-sh_SOURCES = $(PATH_VBoxNetFlt-sh)/build_in_tmp
179 VBoxNetFlt-sh_CLEAN = $(PATH_VBoxNetFlt-sh)/build_in_tmp
180
181
182includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
183$$(PATH_VBoxNetFlt-src)/Makefile: \
184 $(PATH_SUB_CURRENT)/linux/Makefile \
185 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
186 | $$(dir $$@)
187ifndef VBOX_WITH_HARDENING
188 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
189else
190 $(QUIET)$(CP) -f $< $@
191endif
192 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
193 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
194
195## Scripts needed for building the kernel modules
196
197$$(PATH_VBoxNetFlt-sh)/build_in_tmp: \
198 $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/build_in_tmp \
199 $(VBOX_VERSION_STAMP) \
200 | $$(dir $$@)
201 $(call MSG_TOOL,Creating,,$@)
202 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetflt;g" --output $@ $<
203 $(QUIET)chmod 0755 $@
204
205$$(PATH_VBoxNetFlt-src)/dkms.conf: \
206 $(PATH_SUB_CURRENT)/dkms.conf \
207 $(VBOX_VERSION_STAMP) \
208 | $$(dir $$@)
209 $(call MSG_TOOL,Creating,,$@)
210 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
211
212endif # linux
213
214include $(KBUILD_PATH)/subfooter.kmk
215
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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