VirtualBox

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

Last change on this file since 32183 was 32183, checked in by vboxsync, 14 years ago

Linux Installer/Additions: attempt to properly register the host/guest kernel modules at DKMS and use the setup function of the service script to compile the modules instead of doing this separately in the installer scripts

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.5 KB
Line 
1# $Id: Makefile.kmk 32183 2010-09-01 15:53:42Z vboxsync $
2## @file
3# Sub-Makefile for the Network Adapter Driver (VBoxNetAdp).
4#
5
6#
7# Copyright (C) 2009-2010 Oracle Corporation
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
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21
22if1of ($(KBUILD_TARGET), solaris darwin linux freebsd)
23#
24# VBoxNetAdp - Virtual Network Adapter
25# Note! On Solaris the name has to be <= 8 chars long.
26#
27 ifdef VBOX_WITH_VBOXDRV
28SYSMODS += VBoxNetAdp
29VBoxNetAdp_TEMPLATE = VBOXR0DRV
30VBoxNetAdp_INST = $(INST_VBOXNETADP)$(if $(eq $(KBUILD_TARGET),darwin),Contents/MacOS/)
31VBoxNetAdp_NAME.solaris = vboxnet
32VBoxNetAdp_NAME.linux = vboxnetadp
33VBoxNetAdp_NAME.freebsd = vboxnetadp
34VBoxNetAdp_NOINST.linux = true
35VBoxNetAdp_DEPS.solaris += $(VBOX_SVN_REV_KMK)
36VBoxNetAdp_DEFS = IN_RT_R0 VBOX_SVN_REV=$(VBOX_SVN_REV) IN_SUP_STATIC
37VBoxNetAdp_DEFS.linux = KBUILD_MODNAME=KBUILD_STR\(vboxnetadp\) KBUILD_BASENAME=KBUILD_STR\(vboxnetadp\) MODULE
38#VBoxNetAdp_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
39VBoxNetAdp_LDFLAGS.solaris += -N misc/gld -N drv/vboxdrv
40VBoxNetAdp_INCS.linux := \
41 $(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
42VBoxNetAdp_INCS = \
43 .
44VBoxNetAdp_SOURCES.darwin = \
45 darwin/VBoxNetAdp-darwin.cpp \
46 VBoxNetAdp.c
47VBoxNetAdp_SOURCES.solaris = \
48 solaris/VBoxNetAdp-solaris.c
49VBoxNetAdp_SOURCES.linux = \
50 linux/VBoxNetAdp-linux.c \
51 VBoxNetAdp.c
52VBoxNetAdp_SOURCES.freebsd = \
53 freebsd/VBoxNetAdp-freebsd.c \
54 VBoxNetAdp.c
55VBoxNetAdp_SOURCES =
56#VBoxNetAdp_SOURCES = \
57# VBoxNetAdp.c
58VBoxNetAdp_LIBS += \
59 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB)
60 endif
61endif
62
63#
64# Darwin extras.
65#
66ifeq ($(KBUILD_TARGET),darwin)
67INSTALLS += VBoxNetAdp.kext
68VBoxNetAdp.kext_INST = $(INST_VBOXNETADP)Contents/
69VBoxNetAdp.kext_SOURCES = \
70 $(PATH_VBoxNetAdp.kext)/Info.plist
71VBoxNetAdp.kext_CLEAN = \
72 $(PATH_VBoxNetAdp.kext)/Info.plist
73
74$$(PATH_VBoxNetAdp.kext)/Info.plist: $(PATH_SUB_CURRENT)/darwin/Info.plist $(VBOX_VERSION_MK) | $$(dir $$@)
75 $(call MSG_GENERATE,VBoxNetAdp,$@,$<)
76 $(QUIET)$(RM) -f $@
77 $(QUIET)$(SED) \
78 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
79 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
80 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
81 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
82 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
83 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
84 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
85 --output $@ \
86 $<
87
88INSTALLS.darwin += Scripts-darwin-adp
89Scripts-darwin-adp_INST = $(INST_DIST)
90Scripts-darwin-adp_SOURCES = \
91 darwin/loadnetadp.sh
92endif # darwin
93
94ifeq ($(KBUILD_TARGET),linux)
95 #
96 # Install source files for compliation on Linux.
97 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
98 #
99 include $(PATH_SUB_CURRENT)/linux/files_vboxnetadp
100 INSTALLS += VBoxNetAdp-src VBoxNetAdp-sh
101 VBoxNetAdp-src_INST = bin/src/vboxnetadp/
102 VBoxNetAdp-src_MODE = a+r,u+w
103 VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
104 VBoxNetAdp-src_SOURCES+= \
105 $(PATH_VBoxNetAdp-src)/Makefile
106 VBoxNetAdp-src_CLEAN = \
107 $(PATH_VBoxNetAdp-src)/Makefile \
108 $(PATH_TARGET)/VBoxNetAdp-src-1.dep
109
110 VBoxNetAdp-sh_INST = bin/src/vboxnetadp/
111 VBoxNetAdp-sh_MODE = a+rx,u+w
112 VBoxNetAdp-sh_SOURCES = \
113 $(PATH_VBoxNetAdp-sh)/build_in_tmp \
114 $(PATH_ROOT)/src/VBox/HostDrivers/linux/do_Module.symvers
115 VBoxNetAdp-sh_CLEAN = $(PATH_VBoxNetAdp-sh)/build_in_tmp
116
117
118includedep $(PATH_TARGET)/VBoxNetAdp-src-1.dep
119$$(PATH_VBoxNetAdp-src)/Makefile: \
120 $(PATH_SUB_CURRENT)/linux/Makefile \
121 $$(if $$(eq $$(VBoxNetAdp/linux/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
122 | $$(dir $$@)
123ifndef VBOX_WITH_HARDENING
124 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
125else
126 $(QUIET)$(CP) -f $< $@
127endif
128 %$(QUIET2)$(RM) -f -- $(PATH_TARGET)/VBoxNetAdp-src-1.dep
129 %$(QUIET2)$(APPEND) '$(PATH_TARGET)/VBoxNetAdp-src-1.dep' 'VBoxNetAdp/linux/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
130
131## Scripts needed for building the kernel modules
132
133$$(PATH_VBoxNetAdp-sh)/build_in_tmp: \
134 $(PATH_ROOT)/src/VBox/HostDrivers/linux/build_in_tmp \
135 $(VBOX_VERSION_STAMP) \
136 | $$(dir $$@)
137 $(call MSG_TOOL,Creating,,$@)
138 $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetadp;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $<
139 $(QUIET)chmod 0755 $@
140
141endif # linux
142
143ifeq ($(KBUILD_TARGET),freebsd)
144 #
145 # Install source files for compliation on FreeBSD.
146 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
147 #
148 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetadp
149 INSTALLS += VBoxNetAdp-src
150 VBoxNetAdp-src_INST = bin/src/vboxnetadp/
151 VBoxNetAdp-src_MODE = a+r,u+w
152 VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
153 VBoxNetAdp-src_SOURCES+= \
154 $(PATH_VBoxNetAdp-src)/Makefile
155 VBoxNetAdp-src_CLEAN = \
156 $(PATH_VBoxNetAdp-src)/Makefile \
157
158$$(PATH_VBoxNetAdp-src)/Makefile: \
159 $(PATH_SUB_CURRENT)/freebsd/Makefile \
160 $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
161 | $$(dir $$@)
162ifndef VBOX_WITH_HARDENING
163 $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
164else
165 $(QUIET)$(CP) -f $< $@
166endif
167
168endif # freebsd
169
170include $(KBUILD_PATH)/subfooter.kmk
171
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