VirtualBox

source: vbox/trunk/src/VBox/Additions/linux/Makefile.kmk@ 62489

Last change on this file since 62489 was 59180, checked in by vboxsync, 9 years ago

bugref:8087: Additions/x11: support non-root X server: switch our method of loading our GL library to simply overriding the system one. If our 3D library is loaded by the X server (we check this by seeing if the DISPLAY environment variable is unset; we cannot do anything useful in this case anyway), we load the original system library using deep binding, as the default X server GLX module is tied to the Mesa GL implementation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.0 KB
Line 
1# $Id: Makefile.kmk 59180 2015-12-18 11:17:06Z vboxsync $
2## @file
3# Makefile for the linux guest additions base directory.
4#
5
6#
7# Copyright (C) 2006-2015 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#
22# Include sub-makefiles.
23#
24include $(PATH_SUB_CURRENT)/sharedfolders/Makefile.kmk
25include $(PATH_SUB_CURRENT)/drm/Makefile.kmk
26ifdef VBOX_WITH_LIGHTDM_GREETER
27 include $(PATH_SUB_CURRENT)/lightdm-greeter/Makefile.kmk
28endif
29
30#
31# Globals
32#
33
34# Basic path components
35VBOX_LNX_ADD_PACKAGE_NAME := VBoxGuestAdditions
36VBOX_LNX_ADD_INST_OUT_DIR := $(PATH_TARGET)/Additions/Installer/linux/
37VBOX_LNX_ADD_INST_DBG_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)debug/
38VBOX_LNX_ADD_INST_STAGE_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)install/
39
40# Installation paths for binaries and files
41VBOX_LNX_ADD_INST_BIN_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)bin/
42VBOX_LNX_ADD_INST_SBIN_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)sbin/
43VBOX_LNX_ADD_INST_LIB_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)lib/
44VBOX_LNX_ADD_INST_SHARE_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)share/
45VBOX_LNX_ADD_INST_MOD_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
46VBOX_LNX_ADD_INST_KMOD_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)src/
47VBOX_LNX_ADD_INST_KMOD_DIR_MOD := $(VBOX_LNX_ADD_INST_OUT_DIR)src/vboxguest-$(VBOX_VERSION_STRING)/
48VBOX_LNX_ADD_INST_INIT_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)init/
49
50VBOX_LNX_ADD_ARCH_INST_DIRS := \
51 $(VBOX_LNX_ADD_INST_OUT_DIR) \
52 $(VBOX_LNX_ADD_INST_BIN_DIR) \
53 $(VBOX_LNX_ADD_INST_SBIN_DIR) \
54 $(VBOX_LNX_ADD_INST_LIB_DIR) \
55 $(VBOX_LNX_ADD_INST_MOD_DIR) \
56 $(VBOX_LNX_ADD_INST_KMOD_DIR) \
57 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD) \
58 $(VBOX_LNX_ADD_INST_INIT_DIR)
59
60# Installation paths for debug symbols
61VBOX_LNX_ADD_DBG_BIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)bin/
62VBOX_LNX_ADD_DBG_SBIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)sbin/
63VBOX_LNX_ADD_DBG_LIB_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/
64VBOX_LNX_ADD_DBG_MOD_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
65
66VBOX_LNX_ADD_DBG_DIRS := \
67 $(VBOX_LNX_ADD_DBG_BIN_DIR) \
68 $(VBOX_LNX_ADD_DBG_SBIN_DIR) \
69 $(VBOX_LNX_ADD_DBG_LIB_DIR) \
70 $(VBOX_LNX_ADD_DBG_MOD_DIR)
71
72# Script source directories
73VBOX_PATH_LNX_ADD_INST := $(PATH_SUB_CURRENT)/installer/
74VBOX_REL_LNX_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_ADD_INST))
75VBOX_PATH_X11_ADD_INST := $(PATH_ROOT)/src/VBox/Additions/x11/Installer/
76VBOX_REL_X11_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_X11_ADD_INST))
77VBOX_PATH_LNX_INST_SRC := $(PATH_ROOT)/src/VBox/Installer/linux/
78VBOX_REL_LNX_INST_SRC := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_INST_SRC))
79VBOX_PATH_LNX_HOST_DRV := $(PATH_ROOT)/src/VBox/HostDrivers/linux/
80VBOX_REL_LNX_HOST_DRV := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_HOST_DRV))
81
82# Unset this to speed up things during makefile hacking.
83VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
84
85
86#
87# Targets
88#
89VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
90VBOX_LNX_ADD_ARCHIVE.x86 := $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-x86.tar.bz2
91VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64.tar.bz2
92ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
93 VBOX_LNX_ADD_ARCHIVES := $(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH).tar.bz2
94else
95 VBOX_LNX_ADD_ARCHIVES := \
96 $(VBOX_LNX_ADD_ARCHIVE.x86) \
97 $(VBOX_LNX_ADD_ARCHIVE.amd64)
98endif
99BLDDIRS += \
100 $(VBOX_LNX_ADD_ARCH_INST_DIRS) \
101 $(VBOX_LNX_ADD_DBG_DIRS) \
102 $(VBOX_LNX_ADD_INST_STAGE_DIR)
103
104# Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
105# This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
106PACKING += \
107 $(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run,) \
108 $(VBOX_LNX_ADD_ARCHIVES) \
109 $(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
110OTHER_CLEAN += \
111 $(PACKING) \
112 $(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
113
114
115#
116# Files to install
117#
118VBOX_ADD_STRIP_BIN += \
119 VBoxControl
120
121VBOX_ADD_STRIP_BIN.linux += \
122 VBoxClient
123
124VBOX_ADD_STRIP_SBIN += \
125 VBoxService \
126 $(if $(VBOX_WITH_LIGHTDM_GREETER),vbox-greeter)
127
128ifdef VBOX_WITH_CROGL
129VBOX_ADD_STRIP_LIB += \
130 VBoxOGLarrayspu.so \
131 VBoxOGLcrutil.so \
132 VBoxOGLerrorspu.so \
133 VBoxOGLfeedbackspu.so \
134 VBoxOGLpackspu.so \
135 VBoxOGLpassthroughspu.so \
136 VBoxOGL.so \
137 VBoxEGL.so
138endif
139
140VBOX_ADD_STRIP_MOD.linux = \
141 vboxmouse_drv_70.so \
142 vboxmouse_drv_71.so \
143 vboxmouse_drv_13.so \
144 vboxmouse_drv_14.so \
145 vboxmouse_drv_15.so \
146 vboxmouse_drv_16.so \
147 $(addsuffix .so,$(filter-out %_32,$(filter vboxvideo_drv_%,$(DLLS)))) \
148 $(if $(VBOX_WITH_PAM),pam_vbox.so,) \
149 mount.vboxsf
150
151VBOX_ADD_MOD.linux = \
152 98vboxadd-xclient \
153 x11config.sh
154
155VBOX_ADD_STRIP_OBJ.linux = \
156 vboxmouse_drv.o \
157 vboxvideo_drv.o
158
159VBOX_ADD_KMOD_FILES = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, Makefile build_in_tmp)
160VBOX_ADD_KMOD_DIRS = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, vboxguest/ vboxsf/ vboxvideo/)
161
162VBOX_ADD_INIT.linux = \
163 vboxadd \
164 vboxadd-service \
165 vboxadd-x11
166
167VBOX_LNX_ADD_STRIP_BIN = $(VBOX_ADD_STRIP_BIN) $(VBOX_ADD_STRIP_BIN.linux)
168VBOX_LNX_ADD_BIN = $(VBOX_ADD_BIN) $(VBOX_ADD_BIN.linux)
169VBOX_LNX_ADD_STRIP_SBIN= $(VBOX_ADD_STRIP_SBIN) $(VBOX_ADD_STRIP_SBIN.linux)
170VBOX_LNX_ADD_STRIP_LIB = $(VBOX_ADD_STRIP_LIB) $(VBOX_ADD_STRIP_LIB.linux)
171VBOX_LNX_ADD_STRIP_MOD = $(VBOX_ADD_STRIP_MOD) $(VBOX_ADD_STRIP_MOD.linux)
172VBOX_LNX_ADD_MOD = $(VBOX_ADD_MOD) $(VBOX_ADD_MOD.linux)
173VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
174VBOX_LNX_ADD_KMOD_FILES= $(VBOX_ADD_KMOD_FILES)
175VBOX_LNX_ADD_KMOD_DIRS = $(VBOX_ADD_KMOD_DIRS)
176VBOX_LNX_ADD_INIT = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
177
178#
179# All the files that go into the archive
180#
181VBOX_LNX_ADD_INST_FILES := \
182 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
183 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_BIN)) \
184 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
185 $(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
186 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
187 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
188 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
189 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)) \
190 $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
191 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
192
193## @todo figure how to clean these... Or maybe rewrite everything here to somehow use install targets?
194VBOX_LNX_ADD_INST_DIRS := \
195 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS))
196
197VBOX_LNX_ADD_DBG_FILES := \
198 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
199 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
200 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
201 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
202
203ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
204VBOX_LNX_ADD_INST_FILES += \
205 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter)
206endif
207
208# Cleanup of the the installer directory files
209OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DBG_FILES)
210
211# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
212$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
213 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
214 $(call MSG_TOOL,copydbg,$<,$@)
215 $(QUIET)objcopy --only-keep-debug $< $@
216
217$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
218 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
219 $(call MSG_TOOL,copydbg,$<,$@)
220 $(QUIET)objcopy --only-keep-debug $< $@
221
222$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
223 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
224 $(call MSG_TOOL,copydbg,$<,$@)
225 $(QUIET)objcopy --only-keep-debug $< $@
226
227$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
228 $(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
229 $(call MSG_TOOL,copydbg,$<,$@)
230 $(QUIET)objcopy --only-keep-debug $< $@
231
232# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
233$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
234 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
235 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
236 | $$(dir $$@)
237 $(call MSG_INST_FILE,$<,$@)
238 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
239 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_DBG_BIN_DIR),$@) $@
240
241# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
242$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),\
243 $(filter-out vbox-greeter,$(VBOX_LNX_ADD_STRIP_SBIN))): \
244 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
245 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
246 | $$(dir $$@)
247 $(call MSG_INST_FILE,$<,$@)
248 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
249 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_DBG_SBIN_DIR),$@) $@
250
251# pattern rule for stripping and copying vbox-greeter to the installation directory
252$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter): \
253 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(subst linux.amd64/release,linux.amd64/release/greeter,$(subst linux.x86/release,linux.x86/release/greeter,$(PATH_STAGE_BIN)))/additions/% \
254 | $$(dir $$@)
255 $(call MSG_INST_FILE,$<,$@)
256 $(QUIET)$(INSTALL) -m 0755 $< $@
257
258# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
259$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
260 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% \
261 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
262 | $$(dir $$@)
263 $(call MSG_INST_FILE,$<,$@)
264 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
265 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_DBG_LIB_DIR),$@) $@
266
267# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
268$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
269 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% \
270 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
271 | $$(dir $$@)
272 $(call MSG_INST_FILE,$<,$@)
273 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
274 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_DBG_MOD_DIR),$@) $@
275
276# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
277$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
278 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
279 $(call MSG_INST_FILE,$<,$@)
280ifeq ($(VBOX_DO_STRIP),)
281 $(QUIET)$(INSTALL) -m 0644 $< $@
282else # strip to temp file because of umask.
283 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
284 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
285 $(QUIET)$(RM) -f -- $@.tmp
286endif
287
288# pattern rules for copying the VBOX_LNX_ADD_KMOD files to the installation directory
289$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS)): \
290 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
291 $(PATH_STAGE_BIN)/additions/src/% \
292 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*) \
293 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*) \
294 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*) \
295 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*/*) \
296 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*/*/*) \
297 $(VBOX_VERSION_STAMP) $(VBOX_SVN_REV_HEADER) \
298 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
299 $(call MSG_INST_DIR,$<,$@)
300 $(QUIET)$(RM) -Rf $(filter-out $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD),$(wildcard $(VBOX_LNX_ADD_INST_KMOD_DIR)*/))
301 $(QUIET)$(CP) -RPf -- $< $@
302
303$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)): \
304 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
305 $(PATH_STAGE_BIN)/additions/src/% \
306 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
307 $(call MSG_INST_FILE,$<,$@)
308 $(QUIET)$(CP) -RPf -- $< $@
309
310# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
311$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
312 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
313 $(call MSG_INST_FILE,$<,$@)
314# Remove target directories first, otherwise the behaviour of cp will not be
315# what we want if it already exists. See the cp manual page for more details.
316 $(QUIET)$(RM) -Rf $@
317 $(QUIET)$(CP) -RPf -- $< $@
318
319# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
320$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
321 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
322 $(call MSG_INST_FILE,$<,$@)
323# Remove target directories first, otherwise the behaviour of cp will not be
324# what we want if it already exists. See the cp manual page for more details.
325 $(QUIET)$(RM) -Rf $@
326 $(QUIET)$(CP) -RPf -- $< $@
327
328INSTALLS += GuestDrivers-src
329GuestDrivers-src_INST = $(INST_ADDITIONS)src/
330GuestDrivers-src_MODE = a+r,u+w
331GuestDrivers-src_SOURCES = Makefile
332
333
334INSTALLS += lnx_add_inst-exec
335lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_MOD_DIR)
336lnx_add_inst-exec_INSTTYPE = stage
337lnx_add_inst-exec_EXEC_SOURCES = \
338 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
339 $(VBOX_REL_X11_ADD_INST)x11config.sh
340
341
342INSTALLS += lnx_add_inst-noexec
343lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)/
344lnx_add_inst-noexec_INSTTYPE = stage
345lnx_add_inst-noexec_SOURCES = \
346 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
347 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
348 $(if $(VBOX_WITH_LIGHTDM_GREETER_PACKING),lightdm-greeter/vbox-greeter.desktop,) \
349 selinux-fedora/vbox_x11.pp \
350 selinux-fedora/vbox_accel.pp
351
352INSTALLS += lnx_add_inst-license
353lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
354lnx_add_inst-license_INSTTYPE = stage
355lnx_add_inst-license_SOURCES = \
356 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
357
358
359#
360# We need our routines.sh and the uninstallation scripts in the staging
361# directory too
362#
363INSTALLS += LnxAdd-scripts
364LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
365LnxAdd-scripts_INSTTYPE = stage
366LnxAdd-scripts_SOURCES = \
367 $(VBOX_REL_LNX_ADD_INST)deffiles
368LnxAdd-scripts_EXEC_SOURCES = \
369 $(VBOX_REL_LNX_INST_SRC)routines.sh \
370 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
371 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
372 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11
373
374ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
375 LnxAdd-scripts_EXEC_SOURCES += \
376 $(VBOX_REL_LNX_ADD_INST)module-autologon.sh=>installer/module-autologon
377endif
378
379
380#
381# And the init scripts
382#
383INSTALLS += LnxAdd-init-scripts
384LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
385LnxAdd-init-scripts_EXEC_SOURCES = \
386 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
387
388
389# this file needs editing before it can be included in the generic installer.
390$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
391 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh \
392 $(VBOX_VERSION_STAMP) | $$(dir $$@)
393 $(RM) -f -- $@
394 $(QUIET)$(SED) \
395 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
396 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
397 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
398 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
399 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
400 -e "s;_USERNAME_;$(USERNAME);g" \
401 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
402 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxvfs vboxadd-timesync vboxadd-service vboxadd;g" \
403 --output $@ \
404 $<
405 $(QUIET)$(CHMOD) 0755 $@
406OTHER_CLEAN += \
407 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
408 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
409
410
411include $(FILE_KBUILD_SUB_FOOTER)
412
413
414# All the files that go into our archive
415VBOX_LNX_ADD_ARCH_FILES = \
416 $(lnx_add_inst-noexec_2_STAGE_TARGETS) \
417 $(lnx_add_inst-exec_2_STAGE_TARGETS) \
418 $(lnx_add_inst-license_2_STAGE_TARGETS) \
419 $(VBOX_LNX_ADD_INST_FILES) \
420 $(VBOX_LNX_ADD_INST_DIRS)
421
422#
423# .tar.bz2 for converting into .run
424#
425$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
426 $(VBOX_LNX_ADD_ARCH_FILES) \
427 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
428 $(VBOX_VERSION_STAMP)
429 $(call MSG_L1,Packing $@)
430 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
431 $(QUIET)$(MKDIR) -p $(@D)
432 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_ARCH_INST_DIRS)
433ifdef VBOX_USE_PBZIP2
434 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
435 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
436 LICENSE bin init lib sbin share src \
437 $(if $(filter $(KBUILD_TYPE),debug),debug)
438 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
439else
440 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
441 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
442 LICENSE bin init lib sbin share src \
443 $(if $(filter $(KBUILD_TYPE),debug),debug)
444endif
445 $(QUIET)$(CHMOD) 0644 $@
446
447
448#
449# .tar.bz2 containing the debug information
450#
451$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
452 $(VBOX_LNX_ADD_DBG_FILES) \
453 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
454 $(call MSG_L1,Packing $@)
455 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
456 $(QUIET)$(MKDIR) -p $(@D)
457 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_DBG_DIRS)
458ifdef VBOX_USE_PBZIP2
459 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
460 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
461 bin lib sbin
462 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
463else
464 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
465 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
466 bin lib sbin
467endif
468 $(QUIET)$(CHMOD) 0644 $@
469
470
471#
472# Build the Linux Guest Additions self extracting installer.
473#
474# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
475# any references should be made via variables assigned a know value via := .
476#
477$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
478 $(VBOX_LNX_ADD_ARCHIVES) \
479 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
480 $$(LnxAdd-scripts_2_STAGE_TARGETS) \
481 $(VBOX_VERSION_STAMP)
482 # Remove any archives left over from previous builds so that they don't
483 # end up in our installer as well.
484 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
485 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
486 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
487 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
488 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
489 /bin/sh ./install.sh "\$$0 1> /dev/null"
490
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