1 | # $Id: Makefile.kmk 12974 2008-10-03 18:54:37Z 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 |
|
---|
13 | SUB_DEPTH = ../../../..
|
---|
14 | include $(KBUILD_PATH)/subheader.kmk
|
---|
15 |
|
---|
16 |
|
---|
17 | if1of ($(KBUILD_TARGET), darwin win)
|
---|
18 | #
|
---|
19 | # VBoxNetFlt.sys - The mixed case driver.
|
---|
20 | #
|
---|
21 | SYSMODS += VBoxNetFlt
|
---|
22 | VBoxNetFlt_TEMPLATE = VBOXR0DRV
|
---|
23 | VBoxNetFlt_INST = $(INST_VBOXNETFLT)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
|
---|
24 | if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win"
|
---|
25 | VBoxNetFlt_NOINST = true
|
---|
26 | endif
|
---|
27 | VBoxNetFlt_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
|
---|
28 | VBoxNetFlt_SDKS.win = W2K3DDK WINPSDKINCS
|
---|
29 | VBoxNetFlt_INCS := $(PATH_SUB_CURRENT)
|
---|
30 | VBoxNetFlt_SOURCES.darwin = darwin/VBoxNetFlt-darwin.cpp
|
---|
31 | VBoxNetFlt_SOURCES.win = win/VBoxNetFlt-win.c win/VBoxNetFlt-win.rc
|
---|
32 | ifdef VBOX_NETFLT_ONDEMAND_BIND
|
---|
33 | VBoxNetFlt_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
|
---|
34 | endif
|
---|
35 | VBoxNetFlt_SOURCES = VBoxNetFlt.c
|
---|
36 | VBoxNetFlt_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
|
---|
37 | VBoxNetFlt_LDFLAGS.win.x86 = -Entry:DriverEntry@8
|
---|
38 | VBoxNetFlt_LDFLAGS.win.amd64 = -Entry:DriverEntry
|
---|
39 | VBoxNetFlt_LIBS.win = \
|
---|
40 | $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
|
---|
41 | $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
|
---|
42 | $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
|
---|
43 | $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
44 | VBoxNetFlt_LIBS = \
|
---|
45 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
46 |
|
---|
47 |
|
---|
48 | # Darwin extras.
|
---|
49 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
50 | INSTALLS += VBoxNetFlt.kext
|
---|
51 | VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
|
---|
52 | VBoxNetFlt.kext_SOURCES = \
|
---|
53 | $(PATH_VBoxNetFlt.kext)/Info.plist
|
---|
54 | VBoxNetFlt.kext_CLEAN = \
|
---|
55 | $(PATH_VBoxNetFlt.kext)/Info.plist
|
---|
56 |
|
---|
57 | $$(PATH_VBoxNetFlt.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
58 | $(call MSG_GENERATE,VBoxNetFlt,$@,$<)
|
---|
59 | $(xQUIET)$(RM) -f $@
|
---|
60 | $(xQUIET)$(SED) \
|
---|
61 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
62 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
63 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
64 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
65 | --output $@ \
|
---|
66 | $<
|
---|
67 |
|
---|
68 | INSTALLS.darwin += Scripts-darwin
|
---|
69 | Scripts-darwin_INST = $(INST_DIST)
|
---|
70 | Scripts-darwin_SOURCES = \
|
---|
71 | darwin/loadnetflt.sh
|
---|
72 | endif # darwin
|
---|
73 |
|
---|
74 |
|
---|
75 | # Windows extras.
|
---|
76 | INSTALLS.win += VBoxNetFlt-inf
|
---|
77 | VBoxNetFlt-inf_INST = $(INST_BIN)
|
---|
78 | VBoxNetFlt-inf_MODE = a+r,u+w
|
---|
79 | VBoxNetFlt-inf_SOURCES = \
|
---|
80 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
81 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf
|
---|
82 | VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
|
---|
83 | VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
|
---|
84 |
|
---|
85 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
86 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
87 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
88 |
|
---|
89 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
90 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
91 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
92 |
|
---|
93 | ifdef VBOX_SIGNING_MODE
|
---|
94 | VBoxNetFlt-inf_SOURCES += \
|
---|
95 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
|
---|
96 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
|
---|
97 |
|
---|
98 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(dir $$@)
|
---|
99 | $(INSTALL) -m 644 $< $(@D)
|
---|
100 |
|
---|
101 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
|
---|
102 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
103 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf \
|
---|
104 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
|
---|
105 | $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
|
---|
106 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
107 | endif # signing
|
---|
108 |
|
---|
109 |
|
---|
110 | else if1of ($(KBUILD_TARGET), linux solaris)
|
---|
111 | #
|
---|
112 | # vboxnetflt(.ko/.o/) - The lower case driver.
|
---|
113 | # Note! On Solaris the name has to be <= 8 chars long.
|
---|
114 | #
|
---|
115 | SYSMODS += vboxnetflt
|
---|
116 | vboxnetflt_TEMPLATE = VBOXR0DRV
|
---|
117 | vboxnetflt_NAME.solaris = vboxflt
|
---|
118 | vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
|
---|
119 | vboxnetflt_DEFS = IN_RT_R0
|
---|
120 | vboxnetflt_INCS.linux := \
|
---|
121 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
122 | vboxnetflt_INCS := \
|
---|
123 | $(PATH_SUB_CURRENT)
|
---|
124 | vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv
|
---|
125 | vboxnetflt_LIBS = \
|
---|
126 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
127 | ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
|
---|
128 | vboxnetflt_LIBS += \
|
---|
129 | $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
130 | vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
|
---|
131 | vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
|
---|
132 | vboxnetflt_SOURCES = VBoxNetFlt.c
|
---|
133 |
|
---|
134 | endif
|
---|
135 |
|
---|
136 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
137 |
|
---|