VirtualBox

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

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

Solaris/VBoxNetFlt: netinfo for IPFilter compat. disabled.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 6.8 KB
 
1# $Id: Makefile.kmk 13730 2008-11-01 16:09:13Z 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/VBoxNetFltNf-win.c \
35 win/VBoxNetFlt-win.rc
36ifdef VBOX_NETFLT_ONDEMAND_BIND
37 VBoxNetFlt_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
38else
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
83# Windows extras.
84INSTALLS.win += VBoxNetFlt-inf
85VBoxNetFlt-inf_INST = $(INST_BIN)
86VBoxNetFlt-inf_MODE = a+r,u+w
87VBoxNetFlt-inf_SOURCES = \
88 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
89 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf
90VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
91VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
92
93$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
94 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
95 $(call VBOX_EDIT_INF_FN,$<,$@)
96
97$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
98 $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
99 $(call VBOX_EDIT_INF_FN,$<,$@)
100
101 ifdef VBOX_SIGNING_MODE
102VBoxNetFlt-inf_SOURCES += \
103 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
104 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
105
106$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(dir $$@)
107 $(INSTALL) -m 644 $< $(@D)
108
109$(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
110 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
111 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf \
112 $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
113 $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
114 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
115 endif # signing
116
117#
118# WinNetConfig - static library with host network interface config API
119#
120LIBRARIES.win += WinNetConfig
121WinNetConfig_TEMPLATE = VBOXR3STATIC
122WinNetConfig_DEFS = _WIN32_WINNT=0x0500 _UNICODE UNICODE
123WinNetConfig_SDKS = WINPSDK W2K3DDK
124WinNetConfig_SOURCES = \
125 win/WinNetConfig.cpp
126
127else if1of ($(KBUILD_TARGET), linux solaris)
128#
129# vboxnetflt(.ko/.o/) - The lower case driver.
130# Note! On Solaris the name has to be <= 8 chars long.
131#
132SYSMODS += vboxnetflt
133vboxnetflt_TEMPLATE = VBOXR0DRV
134vboxnetflt_NAME.solaris = vboxflt
135vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
136vboxnetflt_DEFS = IN_RT_R0
137vboxnetflt_DEFS.solaris += VBOX_SVN_REV=$(VBOX_SVN_REV)
138vboxnetflt_DEPS.solaris += $(VBOX_SVN_REV_KMK)
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
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+= $(PATH_VBoxNetFlt-src)/Makefile
170 VBoxNetFlt-src_CLEAN = $(PATH_VBoxNetFlt-src)/Makefile
171
172includedep $(PATH_TARGET)/VBoxNetFlt-src-1.dep
173$$(PATH_VBoxNetFlt-src)/Makefile: \
174 $(PATH_SUB_CURRENT)/linux/Makefile \
175 $$(if $$(eq $$(VBoxNetFlt/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
176 | $$(dir $$@)
177ifndef VBOX_WITH_HARDENING
178 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
179else
180 $(QUIET)$(CP) -f $< $@
181endif
182 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetFlt-src-1.dep
183 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetFlt-src-1.dep' 'VBoxNetFlt/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
184
185## Scripts needed for building the kernel modules
186### @todo generate these else where and move them from OTHERS to vboxmod-bin (which btw installs NOBIN files contrary to its name).
187#
188#$(PATH_BIN)/src/build_in_tmp: \
189# $(PATH_SUB_CURRENT)/linux/build_in_tmp \
190# $(VBOX_VERSION_STAMP)
191# $(call MSG_TOOL,Creating,,$@)
192# $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxdrv;g" --output $@ $<
193# $(QUIET)chmod 0755 $@
194#
195#$(PATH_BIN)/src/dkms.conf: \
196# $(PATH_SUB_CURRENT)/linux/dkms.conf \
197# $(VBOX_VERSION_STAMP)
198# $(call MSG_TOOL,Creating,,$@)
199# $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
200
201endif # linux
202
203include $(KBUILD_PATH)/subfooter.kmk
204
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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