VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk@ 20413

Last change on this file since 20413 was 18973, checked in by vboxsync, 16 years ago

#2954: Dynamic add/remove for virtual adapters. Moved all adapter-related code to vboxnetadp.ko

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.0 KB
Line 
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
22SUB_DEPTH = ../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25
26if1of ($(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
32SYSMODS += VBoxNetAdp
33VBoxNetAdp_TEMPLATE = VBOXR0DRV
34VBoxNetAdp_INST = $(INST_VBOXNETADP)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
35VBoxNetAdp_NAME.solaris = vboxnet
36VBoxNetAdp_NAME.linux = vboxnetadp
37VBoxNetAdp_NOINST.linux = true
38VBoxNetAdp_DEPS.solaris += $(VBOX_SVN_REV_KMK)
39VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
40VBoxNetAdp_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetadp\) KBUILD_BASENAME=KBUILD_STR\(vboxnetadp\) MODULE
41VBoxNetAdp_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
42VBoxNetAdp_LDFLAGS.solaris += -N misc/gld -N drv/vboxdrv
43VBoxNetAdp_INCS.linux := \
44 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
45VBoxNetAdp_INCS = \
46 .
47VBoxNetAdp_SOURCES.darwin = \
48 darwin/VBoxNetAdp-darwin.cpp
49VBoxNetAdp_SOURCES.solaris = \
50 solaris/VBoxNetAdp-solaris.c
51VBoxNetAdp_SOURCES.linux = \
52 linux/VBoxNetAdp-linux.c \
53 VBoxNetAdp.c
54VBoxNetAdp_SOURCES =
55#VBoxNetAdp_SOURCES = \
56# VBoxNetAdp.c
57VBoxNetAdp_LIBS.solaris += \
58 $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
59VBoxNetAdp_LIBS += \
60 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
61 endif
62endif
63
64#
65# Darwin extras.
66#
67ifeq ($(KBUILD_TARGET),darwin)
68INSTALLS += VBoxNetAdp.kext
69VBoxNetAdp.kext_INST = $(INST_VBOXNETADP)Contents/
70VBoxNetAdp.kext_SOURCES = \
71 $(PATH_VBoxNetAdp.kext)/Info.plist
72VBoxNetAdp.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
86INSTALLS.darwin += Scripts-darwin-adp
87Scripts-darwin-adp_INST = $(INST_DIST)
88Scripts-darwin-adp_SOURCES = \
89 darwin/loadnetadp.sh
90endif # darwin
91
92ifeq ($(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
120includedep $(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 $$@)
125ifndef VBOX_WITH_HARDENING
126 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
127else
128 $(QUIET)$(CP) -f $< $@
129endif
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
150endif # linux
151
152include $(KBUILD_PATH)/subfooter.kmk
153
Note: See TracBrowser for help on using the repository browser.

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