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