VirtualBox

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

Last change on this file since 39837 was 39665, checked in by vboxsync, 13 years ago

Additions/linux/installer: explicitly set directory permissions, second attempt.

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