1 | # $Id: Makefile.kmk 23452 2009-09-30 20:33:08Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the linux guest additions base directory.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 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 | # Include sub-makefiles.
|
---|
27 | #
|
---|
28 | include $(PATH_SUB_CURRENT)/sharedfolders/Makefile.kmk
|
---|
29 | include $(PATH_SUB_CURRENT)/drm/Makefile.kmk
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Globals
|
---|
33 | #
|
---|
34 | VBOX_LNX_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/linux
|
---|
35 | VBOX_PATH_LINUX_ADDITION_INSTALLER := $(PATH_SUB_CURRENT)/installer
|
---|
36 | VBOX_PATH_X11_ADDITION_INSTALLER := $(PATH_ROOT)/src/VBox/Additions/x11/Installer
|
---|
37 |
|
---|
38 |
|
---|
39 | #
|
---|
40 | # Targets
|
---|
41 | #
|
---|
42 | ifndef VBOX_OSE
|
---|
43 | BLDDIRS += $(VBOX_LNX_ADD_INS_OUT_DIR) $(VBOX_LNX_ADD_INS_OUT_DIR)/module
|
---|
44 | PACKING += $(PATH_BIN)/additions/VBoxLinuxAdditions.run
|
---|
45 | OTHER_CLEAN += $(PACKING)
|
---|
46 | # OSE only contains the source code for this
|
---|
47 | VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
|
---|
48 | endif
|
---|
49 |
|
---|
50 |
|
---|
51 | #
|
---|
52 | # Files to install
|
---|
53 | #
|
---|
54 | VBOX_ADD_STRIP_BIN += \
|
---|
55 | VBoxService \
|
---|
56 | VBoxClient \
|
---|
57 | VBoxControl \
|
---|
58 | VBoxOGLarrayspu.so \
|
---|
59 | VBoxOGLcrutil.so \
|
---|
60 | VBoxOGLerrorspu.so \
|
---|
61 | VBoxOGLfeedbackspu.so \
|
---|
62 | VBoxOGLpackspu.so \
|
---|
63 | VBoxOGLpassthroughspu.so \
|
---|
64 | VBoxOGL.so
|
---|
65 |
|
---|
66 | VBOX_ADD_STRIP_BIN.linux = \
|
---|
67 | vboxmouse_drv_70.so \
|
---|
68 | vboxmouse_drv_71.so \
|
---|
69 | vboxmouse_drv_14.so \
|
---|
70 | vboxmouse_drv_15.so \
|
---|
71 | vboxmouse_drv_16.so \
|
---|
72 | vboxmouse_drv_17.so \
|
---|
73 | vboxvideo_drv_70.so \
|
---|
74 | vboxvideo_drv_71.so \
|
---|
75 | vboxvideo_drv_13.so \
|
---|
76 | vboxvideo_drv_14.so \
|
---|
77 | vboxvideo_drv_15.so \
|
---|
78 | vboxvideo_drv_16.so \
|
---|
79 | vboxvideo_drv_17.so \
|
---|
80 | mount.vboxsf
|
---|
81 |
|
---|
82 | VBOX_ADD_STRIP_OBJ.linux = \
|
---|
83 | vboxmouse_drv.o \
|
---|
84 | vboxvideo_drv.o
|
---|
85 |
|
---|
86 | VBOX_ADD_MODULES.linux = \
|
---|
87 | vboxguest \
|
---|
88 | vboxvfs \
|
---|
89 | vboxvideo_drm
|
---|
90 |
|
---|
91 | VBOX_LNX_ADD_STRIP_BIN = $(VBOX_ADD_STRIP_BIN) $(VBOX_ADD_STRIP_BIN.linux)
|
---|
92 | VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
|
---|
93 | VBOX_LNX_ADD_MODULES = $(VBOX_ADD_MODULES) $(VBOX_ADD_MODULES.linux)
|
---|
94 |
|
---|
95 | #
|
---|
96 | # All the bin files that go into the archives.
|
---|
97 | #
|
---|
98 | VBOX_LNX_ADD_DBG_SYM_FILES := $(addsuffix .dbgsym,$(VBOX_LNX_ADD_STRIP_BIN))
|
---|
99 | VBOX_LNX_ADD_INS_FILES := $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_BIN) $(VBOX_LNX_ADD_STRIP_OBJ) $(VBOX_LNX_ADD_DBG_SYM_FILES))
|
---|
100 | VBOX_LNX_ADD_INS_MODULES := $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/module/,$(VBOX_LNX_ADD_MODULES))
|
---|
101 |
|
---|
102 | # Cleanup of the the installer directory files
|
---|
103 | OTHER_CLEAN += $(VBOX_LNX_ADD_INS_FILES)) $(VBOX_LNX_ADD_INS_MODULES)
|
---|
104 |
|
---|
105 | # pattern rule for copying the debug info from the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
|
---|
106 | $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_DBG_SYM_FILES)): \
|
---|
107 | $(VBOX_LNX_ADD_INS_OUT_DIR)/%.dbgsym : $(PATH_BIN)/additions/% | $$(dir $$@)
|
---|
108 | $(call MSG_TOOL,copydbg,$<,$@)
|
---|
109 | $(QUIET)objcopy --only-keep-debug $< $@
|
---|
110 |
|
---|
111 | # pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
|
---|
112 | $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_BIN)): \
|
---|
113 | $(VBOX_LNX_ADD_INS_OUT_DIR)/% : $(PATH_BIN)/additions/% \
|
---|
114 | $(VBOX_LNX_ADD_INS_OUT_DIR)/%.dbgsym \
|
---|
115 | | $$(dir $$@)
|
---|
116 | $(call MSG_INST_FILE,$<,$@)
|
---|
117 | $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
|
---|
118 | $(QUIET)objcopy --add-gnu-debuglink=$(addsuffix .dbgsym,$@) $@
|
---|
119 |
|
---|
120 | # pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
|
---|
121 | $(addprefix $(VBOX_LNX_ADD_INS_OUT_DIR)/,$(VBOX_LNX_ADD_STRIP_OBJ)): \
|
---|
122 | $(VBOX_LNX_ADD_INS_OUT_DIR)/% : $(PATH_BIN)/additions/% | $$(dir $$@)
|
---|
123 | $(call MSG_INST_FILE,$<,$@)
|
---|
124 | ifeq ($(VBOX_DO_STRIP),)
|
---|
125 | $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
126 | else # strip to temp file because of umask.
|
---|
127 | $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
|
---|
128 | $(QUIET)$(INSTALL) -m 0644 [email protected] $@
|
---|
129 | $(QUIET)$(RM) -f -- [email protected]
|
---|
130 | endif
|
---|
131 |
|
---|
132 | # pattern rule for copying the VBOX_LNX_ADD_MODULES files to the installation directory
|
---|
133 | $(VBOX_LNX_ADD_INS_MODULES): \
|
---|
134 | $(VBOX_LNX_ADD_INS_OUT_DIR)/module/% : $(PATH_BIN)/additions/src/% | $(VBOX_LNX_ADD_INS_OUT_DIR)/module/
|
---|
135 | $(call MSG_INST_FILE,$<,$@)
|
---|
136 | # Remove target directories first, otherwise the behaviour of cp will not be
|
---|
137 | # what we want if it already exists. See the cp manual page for more details.
|
---|
138 | $(QUIET)$(RM) -Rf $@
|
---|
139 | $(QUIET)cp -af $< $(VBOX_LNX_ADD_INS_OUT_DIR)/module
|
---|
140 |
|
---|
141 |
|
---|
142 | INSTALLS += $(if $(VBOX_OSE),, lnx_add_inst-nobin)
|
---|
143 | lnx_add_inst-nobin_INST = obj/Additions/Installer/linux
|
---|
144 | lnx_add_inst-nobin_MODE = a+r,u+w
|
---|
145 | lnx_add_inst-nobin_SOURCES = \
|
---|
146 | ../x11/Installer/VBoxRandR.sh \
|
---|
147 | installer/vboxadd-service.sh \
|
---|
148 | ../x11/Installer/98vboxadd-xclient \
|
---|
149 | ../x11/Installer/vboxclient.desktop \
|
---|
150 | installer/vboxadd.sh \
|
---|
151 | ../x11/Installer/vboxvideo.ids \
|
---|
152 | ../x11/Installer/linux_xorg_suse11.conf \
|
---|
153 | installer/90-vboxguest.fdi
|
---|
154 |
|
---|
155 |
|
---|
156 | INSTALLS += $(if $(VBOX_OSE),, lnx_add_inst-bin)
|
---|
157 | lnx_add_inst-bin_INST = obj/Additions/Installer/linux
|
---|
158 | lnx_add_inst-bin_MODE = a+rx,u+w
|
---|
159 | lnx_add_inst-bin_SOURCES = \
|
---|
160 | ../../Installer/linux/routines.sh \
|
---|
161 | ../x11/Installer/x11config.pl \
|
---|
162 | ../x11/Installer/x11config15.pl \
|
---|
163 | selinux-fedora/vbox_x11.pp
|
---|
164 |
|
---|
165 |
|
---|
166 | INSTALLS += GuestDrivers-src
|
---|
167 | GuestDrivers-src_INST = bin/additions/src/
|
---|
168 | GuestDrivers-src_MODE = a+r,u+w
|
---|
169 | GuestDrivers-src_SOURCES = Makefile
|
---|
170 |
|
---|
171 |
|
---|
172 | INSTALLS += $(if $(VBOX_OSE),, AutoRun-sh)
|
---|
173 | AutoRun-sh_INST = bin/additions/
|
---|
174 | AutoRun-sh_MODE = a+rx,u+w
|
---|
175 | AutoRun-sh_SOURCES = $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/autorun.sh
|
---|
176 |
|
---|
177 |
|
---|
178 | #
|
---|
179 | # Install the sources of our (sanity) test kernel module
|
---|
180 | #
|
---|
181 | INSTALLS += $(if $(VBOX_OSE),, LnxAddTest-src)
|
---|
182 | LnxAddTest-src_INST = obj/Additions/Installer/linux/module/test
|
---|
183 | LnxAddTest-src_MODE = a+r,u+w
|
---|
184 | LnxAddTest-src_SOURCES = \
|
---|
185 | installer/Makefile.test=>Makefile \
|
---|
186 | installer/test.c
|
---|
187 |
|
---|
188 |
|
---|
189 | #
|
---|
190 | # Install the sources of our (sanity) test kernel rendering (DRM) module
|
---|
191 | #
|
---|
192 | INSTALLS += $(if $(VBOX_OSE),, LnxAddDRM-src)
|
---|
193 | LnxAddDRM-src_INST = obj/Additions/Installer/linux/module/test_drm
|
---|
194 | LnxAddDRM-src_MODE = a+r,u+w
|
---|
195 | LnxAddDRM-src_SOURCES = \
|
---|
196 | installer/Makefile.include.header \
|
---|
197 | installer/Makefile.include.footer \
|
---|
198 | installer/Makefile.test.drm=>Makefile \
|
---|
199 | installer/test_drm.c
|
---|
200 |
|
---|
201 |
|
---|
202 | # this file needs editing before it can be included in the generic installer.
|
---|
203 | $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh: \
|
---|
204 | $(VBOX_PATH_LINUX_ADDITION_INSTALLER)/install.sh | $$(dir $$@)
|
---|
205 | $(QUIET)$(SED) \
|
---|
206 | -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
|
---|
207 | -e "s;_BUILD_;$(shell date);g" \
|
---|
208 | -e "s;_OSE_;$(VBOX_OSE);g" \
|
---|
209 | -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
|
---|
210 | -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
|
---|
211 | --output $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh \
|
---|
212 | $<
|
---|
213 | $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh $@
|
---|
214 | $(QUIET)$(RM) $(VBOX_LNX_ADD_INS_OUT_DIR)/install_.sh
|
---|
215 | OTHERS_CLEAN += $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh
|
---|
216 |
|
---|
217 |
|
---|
218 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
219 |
|
---|
220 |
|
---|
221 | #
|
---|
222 | # Build the Linux Guest Additions self extracting installer.
|
---|
223 | #
|
---|
224 | # Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
|
---|
225 | # any references should be made via variables assigned a know value via := .
|
---|
226 | #
|
---|
227 | # We need to depend on all source files for the additions and shared
|
---|
228 | # folders kernel modules.
|
---|
229 | ## @todo Replace the wildcard stuff by the correct file lists now that
|
---|
230 | # we've got everything included.
|
---|
231 | #
|
---|
232 | $(PATH_BIN)/additions/VBoxLinuxAdditions.run: \
|
---|
233 | $(INSTARGET_lnx_add_inst-nobin) \
|
---|
234 | $(INSTARGET_lnx_add_inst-bin) \
|
---|
235 | $(INSTARGET_LnxAddTest-src) \
|
---|
236 | $(INSTARGET_LnxAddTestDRM-src) \
|
---|
237 | $(VBOX_LNX_ADD_INS_FILES) \
|
---|
238 | $(VBOX_LNX_ADD_INS_MODULES) \
|
---|
239 | $(VBOX_LNX_ADD_INS_OUT_DIR)/install.sh \
|
---|
240 | $(wildcard $(PATH_BIN)/additions/src/*) \
|
---|
241 | $(wildcard $(PATH_BIN)/additions/src/*/*) \
|
---|
242 | $(wildcard $(PATH_BIN)/additions/src/*/*/*) \
|
---|
243 | $(wildcard $(PATH_BIN)/additions/src/*/*/*/*) \
|
---|
244 | $(VBOX_VERSION_STAMP)
|
---|
245 | $(QUIET)$(VBOX_MAKESELF) $(VBOX_LNX_ADD_INS_OUT_DIR) $@ \
|
---|
246 | "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux installation" /bin/sh ./install.sh "> /dev/null"
|
---|