1 | # $Id: Makefile.kmk 13435 2008-10-21 12:21:12Z 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_SOURCES.win.amd64 += win/VBoxNetFltA-win.asm
|
---|
40 | VBoxNetFlt_DEFS.win.amd64 += RT_WITH_W64_UNWIND_HACK
|
---|
41 | VBoxNetFlt_LIBS.win = \
|
---|
42 | $(PATH_SDK_W2K3DDK_LIB)/ntoskrnl.lib \
|
---|
43 | $(PATH_SDK_W2K3DDK_LIB)/hal.lib \
|
---|
44 | $(PATH_SDK_W2K3DDK_LIB)/ndis.lib \
|
---|
45 | $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
46 | VBoxNetFlt_LIBS = \
|
---|
47 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
48 |
|
---|
49 |
|
---|
50 | # Darwin extras.
|
---|
51 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
52 | INSTALLS += VBoxNetFlt.kext
|
---|
53 | VBoxNetFlt.kext_INST = $(INST_VBOXNETFLT)Contents/
|
---|
54 | VBoxNetFlt.kext_SOURCES = \
|
---|
55 | $(PATH_VBoxNetFlt.kext)/Info.plist
|
---|
56 | VBoxNetFlt.kext_CLEAN = \
|
---|
57 | $(PATH_VBoxNetFlt.kext)/Info.plist
|
---|
58 |
|
---|
59 | $$(PATH_VBoxNetFlt.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
60 | $(call MSG_GENERATE,VBoxNetFlt,$@,$<)
|
---|
61 | $(xQUIET)$(RM) -f $@
|
---|
62 | $(xQUIET)$(SED) \
|
---|
63 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
64 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
65 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
66 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
67 | --output $@ \
|
---|
68 | $<
|
---|
69 |
|
---|
70 | INSTALLS.darwin += Scripts-darwin
|
---|
71 | Scripts-darwin_INST = $(INST_DIST)
|
---|
72 | Scripts-darwin_SOURCES = \
|
---|
73 | darwin/loadnetflt.sh
|
---|
74 | endif # darwin
|
---|
75 |
|
---|
76 |
|
---|
77 | # Windows extras.
|
---|
78 | INSTALLS.win += VBoxNetFlt-inf
|
---|
79 | VBoxNetFlt-inf_INST = $(INST_BIN)
|
---|
80 | VBoxNetFlt-inf_MODE = a+r,u+w
|
---|
81 | VBoxNetFlt-inf_SOURCES = \
|
---|
82 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
83 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf
|
---|
84 | VBoxNetFlt-inf_CLEAN = $(VBoxNetFlt-inf_SOURCES)
|
---|
85 | VBoxNetFlt-inf_BLDDIRS = $(PATH_TARGET)/VBoxNetFltCat.dir
|
---|
86 |
|
---|
87 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
88 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
89 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
90 |
|
---|
91 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf: $(PATH_SUB_CURRENT)/win/VBoxNetFlt_m.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
92 | $(call MSG_GENERATE,VBoxNetFlt-inf,$@,$<)
|
---|
93 | $(call VBOX_EDIT_INF_FN,$<,$@)
|
---|
94 |
|
---|
95 | ifdef VBOX_SIGNING_MODE
|
---|
96 | VBoxNetFlt-inf_SOURCES += \
|
---|
97 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys \
|
---|
98 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
|
---|
99 |
|
---|
100 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.sys: $$(TARGET_VBoxNetFlt) | $$(dir $$@)
|
---|
101 | $(INSTALL) -m 644 $< $(@D)
|
---|
102 |
|
---|
103 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat: \
|
---|
104 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.inf \
|
---|
105 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt_m.inf \
|
---|
106 | $(PATH_TARGET)/VBoxNetFltCat.dir/VBoxNetFlt.cat
|
---|
107 | $(call MSG_TOOL,Inf2Cat,VBoxNetFlt-inf,$@,$<)
|
---|
108 | $(call VBOX_MAKE_CAT_FN, $(@D),$@)
|
---|
109 | endif # signing
|
---|
110 |
|
---|
111 |
|
---|
112 | else if1of ($(KBUILD_TARGET), linux solaris)
|
---|
113 | #
|
---|
114 | # vboxnetflt(.ko/.o/) - The lower case driver.
|
---|
115 | # Note! On Solaris the name has to be <= 8 chars long.
|
---|
116 | #
|
---|
117 | SYSMODS += vboxnetflt
|
---|
118 | vboxnetflt_TEMPLATE = VBOXR0DRV
|
---|
119 | vboxnetflt_NAME.solaris = vboxflt
|
---|
120 | vboxnetflt_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetflt\) KBUILD_BASENAME=KBUILD_STR\(vboxnetflt\) MODULE
|
---|
121 | vboxnetflt_DEFS = IN_RT_R0
|
---|
122 | vboxnetflt_INCS.linux := \
|
---|
123 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
124 | vboxnetflt_INCS := \
|
---|
125 | $(PATH_SUB_CURRENT)
|
---|
126 | vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv
|
---|
127 | vboxnetflt_LIBS = \
|
---|
128 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
129 | ## @todo vboxflt should resolves all the IPRT bits from vboxdrv.
|
---|
130 | vboxnetflt_LIBS += \
|
---|
131 | $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
132 | vboxnetflt_SOURCES.linux = linux/VBoxNetFlt-linux.c
|
---|
133 | vboxnetflt_SOURCES.solaris = solaris/VBoxNetFlt-solaris.c
|
---|
134 | vboxnetflt_SOURCES = VBoxNetFlt.c
|
---|
135 |
|
---|
136 | endif
|
---|
137 |
|
---|
138 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
139 |
|
---|