1 | # $Id: Makefile.kmk 18973 2009-04-17 06:59:16Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Network Adapter Driver (VBoxNetAdp).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | SUB_DEPTH = ../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 |
|
---|
26 | if1of ($(KBUILD_TARGET), solaris darwin linux)
|
---|
27 | #
|
---|
28 | # VBoxNetAdp - Virtual Network Adapter
|
---|
29 | # Note! On Solaris the name has to be <= 8 chars long.
|
---|
30 | #
|
---|
31 | ifdef VBOX_WITH_VBOXDRV
|
---|
32 | SYSMODS += VBoxNetAdp
|
---|
33 | VBoxNetAdp_TEMPLATE = VBOXR0DRV
|
---|
34 | VBoxNetAdp_INST = $(INST_VBOXNETADP)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
|
---|
35 | VBoxNetAdp_NAME.solaris = vboxnet
|
---|
36 | VBoxNetAdp_NAME.linux = vboxnetadp
|
---|
37 | VBoxNetAdp_NOINST.linux = true
|
---|
38 | VBoxNetAdp_DEPS.solaris += $(VBOX_SVN_REV_KMK)
|
---|
39 | VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
|
---|
40 | VBoxNetAdp_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetadp\) KBUILD_BASENAME=KBUILD_STR\(vboxnetadp\) MODULE
|
---|
41 | VBoxNetAdp_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
|
---|
42 | VBoxNetAdp_LDFLAGS.solaris += -N misc/gld -N drv/vboxdrv
|
---|
43 | VBoxNetAdp_INCS.linux := \
|
---|
44 | $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
|
---|
45 | VBoxNetAdp_INCS = \
|
---|
46 | .
|
---|
47 | VBoxNetAdp_SOURCES.darwin = \
|
---|
48 | darwin/VBoxNetAdp-darwin.cpp
|
---|
49 | VBoxNetAdp_SOURCES.solaris = \
|
---|
50 | solaris/VBoxNetAdp-solaris.c
|
---|
51 | VBoxNetAdp_SOURCES.linux = \
|
---|
52 | linux/VBoxNetAdp-linux.c \
|
---|
53 | VBoxNetAdp.c
|
---|
54 | VBoxNetAdp_SOURCES =
|
---|
55 | #VBoxNetAdp_SOURCES = \
|
---|
56 | # VBoxNetAdp.c
|
---|
57 | VBoxNetAdp_LIBS.solaris += \
|
---|
58 | $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
|
---|
59 | VBoxNetAdp_LIBS += \
|
---|
60 | $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
|
---|
61 | endif
|
---|
62 | endif
|
---|
63 |
|
---|
64 | #
|
---|
65 | # Darwin extras.
|
---|
66 | #
|
---|
67 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
68 | INSTALLS += VBoxNetAdp.kext
|
---|
69 | VBoxNetAdp.kext_INST = $(INST_VBOXNETADP)Contents/
|
---|
70 | VBoxNetAdp.kext_SOURCES = \
|
---|
71 | $(PATH_VBoxNetAdp.kext)/Info.plist
|
---|
72 | VBoxNetAdp.kext_CLEAN = \
|
---|
73 | $(PATH_VBoxNetAdp.kext)/Info.plist
|
---|
74 |
|
---|
75 | $$(PATH_VBoxNetAdp.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
|
---|
76 | $(call MSG_GENERATE,VBoxNetAdp,$@,$<)
|
---|
77 | $(xQUIET)$(RM) -f $@
|
---|
78 | $(xQUIET)$(SED) \
|
---|
79 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
80 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
81 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
82 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
83 | --output $@ \
|
---|
84 | $<
|
---|
85 |
|
---|
86 | INSTALLS.darwin += Scripts-darwin-adp
|
---|
87 | Scripts-darwin-adp_INST = $(INST_DIST)
|
---|
88 | Scripts-darwin-adp_SOURCES = \
|
---|
89 | darwin/loadnetadp.sh
|
---|
90 | endif # darwin
|
---|
91 |
|
---|
92 | ifeq ($(KBUILD_TARGET),linux)
|
---|
93 | #
|
---|
94 | # Install source files for compliation on Linux.
|
---|
95 | # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
|
---|
96 | #
|
---|
97 | include $(PATH_SUB_CURRENT)/linux/files_vboxnetadp
|
---|
98 | INSTALLS += VBoxNetAdp-src VBoxNetAdp-sh
|
---|
99 | VBoxNetAdp-src_INST = bin/src/vboxnetadp/
|
---|
100 | VBoxNetAdp-src_MODE = a+r,u+w
|
---|
101 | VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
|
---|
102 | VBoxNetAdp-src_SOURCES+= \
|
---|
103 | $(if $(VBOX_OSE),,\
|
---|
104 | $(PATH_VBoxNetAdp-src)/dkms.conf) \
|
---|
105 | $(PATH_VBoxNetAdp-src)/Makefile
|
---|
106 | VBoxNetAdp-src_CLEAN = \
|
---|
107 | $(PATH_VBoxNetAdp-src)/dkms.conf \
|
---|
108 | $(PATH_VBoxNetAdp-src)/Makefile \
|
---|
109 | $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
110 |
|
---|
111 | VBoxNetAdp-sh_INST = bin/src/vboxnetadp/
|
---|
112 | VBoxNetAdp-sh_MODE = a+rx,u+w
|
---|
113 | VBoxNetAdp-sh_SOURCES = \
|
---|
114 | $(PATH_VBoxNetAdp-sh)/build_in_tmp \
|
---|
115 | $(if $(VBOX_OSE),,\
|
---|
116 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers)
|
---|
117 | VBoxNetAdp-sh_CLEAN = $(PATH_VBoxNetAdp-sh)/build_in_tmp
|
---|
118 |
|
---|
119 |
|
---|
120 | includedep $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
121 | $$(PATH_VBoxNetAdp-src)/Makefile: \
|
---|
122 | $(PATH_SUB_CURRENT)/linux/Makefile \
|
---|
123 | $$(if $$(eq $$(VBoxNetAdp/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
|
---|
124 | | $$(dir $$@)
|
---|
125 | ifndef VBOX_WITH_HARDENING
|
---|
126 | $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
|
---|
127 | else
|
---|
128 | $(QUIET)$(CP) -f $< $@
|
---|
129 | endif
|
---|
130 | %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetAdp-src-1.dep
|
---|
131 | %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetAdp-src-1.dep' 'VBoxNetAdp/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
|
---|
132 |
|
---|
133 | ## Scripts needed for building the kernel modules
|
---|
134 |
|
---|
135 | $$(PATH_VBoxNetAdp-sh)/build_in_tmp: \
|
---|
136 | $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
|
---|
137 | $(VBOX_VERSION_STAMP) \
|
---|
138 | | $$(dir $$@)
|
---|
139 | $(call MSG_TOOL,Creating,,$@)
|
---|
140 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetadp;g" --output $@ $<
|
---|
141 | $(QUIET)chmod 0755 $@
|
---|
142 |
|
---|
143 | $$(PATH_VBoxNetAdp-src)/dkms.conf: \
|
---|
144 | $(PATH_SUB_CURRENT)/linux/dkms.conf \
|
---|
145 | $(VBOX_VERSION_STAMP) \
|
---|
146 | | $$(dir $$@)
|
---|
147 | $(call MSG_TOOL,Creating,,$@)
|
---|
148 | $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g" --output $@ $<
|
---|
149 |
|
---|
150 | endif # linux
|
---|
151 |
|
---|
152 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
153 |
|
---|