VirtualBox

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

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

Additions/linux/installer: explicitly set directory permissions.

  • 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 39663 2011-12-20 13:52:36Z 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_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_INST_DIRS) \
98 $(VBOX_LNX_ADD_DBG_DIRS) \
99 $(VBOX_LNX_ADD_INST_STAGE_DIR)
100# Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
101# This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
102PACKING += \
103 $(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run,) \
104 $(VBOX_LNX_ADD_ARCHIVES) \
105 $(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
106OTHER_CLEAN += \
107 $(PACKING) \
108 $(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
109
110
111#
112# Files to install
113#
114VBOX_ADD_STRIP_BIN += \
115 VBoxControl
116
117VBOX_ADD_STRIP_BIN.linux += \
118 VBoxClient
119
120VBOX_ADD_BIN.linux += \
121 VBoxClient-all
122
123VBOX_ADD_STRIP_SBIN += \
124 VBoxService
125
126VBOX_ADD_STRIP_LIB += \
127 VBoxOGLarrayspu.so \
128 VBoxOGLcrutil.so \
129 VBoxOGLerrorspu.so \
130 VBoxOGLfeedbackspu.so \
131 VBoxOGLpackspu.so \
132 VBoxOGLpassthroughspu.so \
133 VBoxOGL.so
134
135VBOX_ADD_STRIP_MOD.linux = \
136 vboxmouse_drv_70.so \
137 vboxmouse_drv_71.so \
138 vboxmouse_drv_13.so \
139 vboxmouse_drv_14.so \
140 vboxmouse_drv_15.so \
141 vboxmouse_drv_16.so \
142 vboxvideo_drv_70.so \
143 vboxvideo_drv_71.so \
144 vboxvideo_drv_13.so \
145 vboxvideo_drv_14.so \
146 vboxvideo_drv_15.so \
147 vboxvideo_drv_16.so \
148 vboxvideo_drv_17.so \
149 vboxvideo_drv_18.so \
150 vboxvideo_drv_19.so \
151 vboxvideo_drv_110.so \
152 vboxvideo_drv_111.so \
153 pam_vbox.so \
154 mount.vboxsf
155
156VBOX_ADD_MOD.linux = \
157 98vboxadd-xclient \
158 x11config.sh
159
160VBOX_ADD_STRIP_OBJ.linux = \
161 vboxmouse_drv.o \
162 vboxvideo_drv.o
163
164VBOX_ADD_KMOD_FILES = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, Makefile dkms.conf do_dkms build_in_tmp)
165VBOX_ADD_KMOD_DIRS = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, vboxguest/ vboxsf/ vboxvideo/)
166
167VBOX_ADD_INIT.linux = \
168 vboxadd \
169 vboxadd-service \
170 vboxadd-x11
171
172VBOX_LNX_ADD_STRIP_BIN = $(VBOX_ADD_STRIP_BIN) $(VBOX_ADD_STRIP_BIN.linux)
173VBOX_LNX_ADD_BIN = $(VBOX_ADD_BIN) $(VBOX_ADD_BIN.linux)
174VBOX_LNX_ADD_STRIP_SBIN= $(VBOX_ADD_STRIP_SBIN) $(VBOX_ADD_STRIP_SBIN.linux)
175VBOX_LNX_ADD_STRIP_LIB = $(VBOX_ADD_STRIP_LIB) $(VBOX_ADD_STRIP_LIB.linux)
176VBOX_LNX_ADD_STRIP_MOD = $(VBOX_ADD_STRIP_MOD) $(VBOX_ADD_STRIP_MOD.linux)
177VBOX_LNX_ADD_MOD = $(VBOX_ADD_MOD) $(VBOX_ADD_MOD.linux)
178VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
179VBOX_LNX_ADD_KMOD_FILES= $(VBOX_ADD_KMOD_FILES)
180VBOX_LNX_ADD_KMOD_DIRS = $(VBOX_ADD_KMOD_DIRS)
181VBOX_LNX_ADD_INIT = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
182
183#
184# All the files that go into the archive
185#
186VBOX_LNX_ADD_INST_FILES := \
187 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
188 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_BIN)) \
189 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
190 $(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
191 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
192 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
193 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
194 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)) \
195 $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
196 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
197
198## @todo figure how to clean these... Or maybe rewrite everything here to somehow use install targets?
199VBOX_LNX_ADD_INST_DIRS := \
200 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS))
201
202VBOX_LNX_ADD_DBG_FILES := \
203 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
204 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
205 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
206 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
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=$@ $@
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),$(VBOX_LNX_ADD_STRIP_SBIN)): \
243 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
244 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
245 | $$(dir $$@)
246 $(call MSG_INST_FILE,$<,$@)
247 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
248 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
249
250# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
251$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
252 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% \
253 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
254 | $$(dir $$@)
255 $(call MSG_INST_FILE,$<,$@)
256 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
257 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
258
259# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
260$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
261 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% \
262 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
263 | $$(dir $$@)
264 $(call MSG_INST_FILE,$<,$@)
265 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
266 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
267
268# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
269$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
270 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
271 $(call MSG_INST_FILE,$<,$@)
272ifeq ($(VBOX_DO_STRIP),)
273 $(QUIET)$(INSTALL) -m 0644 $< $@
274else # strip to temp file because of umask.
275 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
276 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
277 $(QUIET)$(RM) -f -- $@.tmp
278endif
279
280# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
281$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS) $(VBOX_LNX_ADD_KMOD_FILES)): \
282 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
283 $(PATH_STAGE_BIN)/additions/src/% \
284 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
285 $(call MSG_INST_DIR,$<,$@)
286 $(QUIET)$(RM) -Rf $@
287 $(QUIET)$(CP) -RPf -- $< $@
288
289# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
290$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
291 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
292 $(call MSG_INST_FILE,$<,$@)
293# Remove target directories first, otherwise the behaviour of cp will not be
294# what we want if it already exists. See the cp manual page for more details.
295 $(QUIET)$(RM) -Rf $@
296 $(QUIET)$(CP) -RPf -- $< $@
297
298# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
299$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
300 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
301 $(call MSG_INST_FILE,$<,$@)
302# Remove target directories first, otherwise the behaviour of cp will not be
303# what we want if it already exists. See the cp manual page for more details.
304 $(QUIET)$(RM) -Rf $@
305 $(QUIET)$(CP) -RPf -- $< $@
306
307
308INSTALLS += GuestDrivers-src
309GuestDrivers-src_INST = $(INST_ADDITIONS)src/
310GuestDrivers-src_MODE = a+r,u+w
311GuestDrivers-src_SOURCES = Makefile
312
313
314INSTALLS += lnx_add_inst-exec
315lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_MOD_DIR)
316lnx_add_inst-exec_INSTTYPE = stage
317lnx_add_inst-exec_EXEC_SOURCES = \
318 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
319 $(VBOX_REL_X11_ADD_INST)x11config.sh
320
321
322INSTALLS += lnx_add_inst-noexec
323lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)/
324lnx_add_inst-noexec_INSTTYPE = stage
325lnx_add_inst-noexec_SOURCES = \
326 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
327 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
328 selinux-fedora/vbox_x11.pp \
329 selinux-fedora/vbox_accel.pp
330
331INSTALLS += lnx_add_inst-license
332lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
333lnx_add_inst-license_INSTTYPE = stage
334lnx_add_inst-license_SOURCES = \
335 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
336
337
338#
339# We need our routines.sh and the uninstallation scripts in the staging
340# directory too
341#
342INSTALLS += LnxAdd-scripts
343LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
344LnxAdd-scripts_INSTTYPE = stage
345LnxAdd-scripts_SOURCES = \
346 $(VBOX_REL_LNX_ADD_INST)deffiles
347LnxAdd-scripts_EXEC_SOURCES = \
348 $(VBOX_REL_LNX_HOST_DRV)do_dkms \
349 $(VBOX_REL_LNX_INST_SRC)routines.sh \
350 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
351 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
352 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
353
354
355#
356# VBoxClient-all
357#
358INSTALLS += LnxAdd-Nostrip-Bin
359LnxAdd-Nostrip-Bin_INST = $(VBOX_LNX_ADD_INST_BIN_DIR)
360LnxAdd-Nostrip-Bin_INSTTYPE = stage
361LnxAdd-Nostrip-Bin_EXEC_SOURCES = \
362 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
363
364
365#
366# And the init scripts
367#
368INSTALLS += LnxAdd-init-scripts
369LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
370LnxAdd-init-scripts_EXEC_SOURCES = \
371 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
372
373
374# this file needs editing before it can be included in the generic installer.
375$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
376 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
377 $(RM) -f -- $@
378 $(QUIET)$(SED) \
379 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
380 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
381 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
382 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
383 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
384 -e "s;_USERNAME_;$(USERNAME);g" \
385 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
386 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxvfs vboxadd-timesync vboxadd-service vboxadd;g" \
387 --output $@ \
388 $<
389 $(QUIET)$(CHMOD) 0755 $@
390OTHER_CLEAN += \
391 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
392 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
393
394
395include $(KBUILD_PATH)/subfooter.kmk
396
397
398# All the files that go into our archive
399VBOX_LNX_ADD_ARCH_FILES = \
400 $(lnx_add_inst-noexec_2_STAGE_TARGETS) \
401 $(lnx_add_inst-exec_2_STAGE_TARGETS) \
402 $(lnx_add_inst-license_2_STAGE_TARGETS) \
403 $(VBOX_LNX_ADD_INST_FILES) \
404 $(VBOX_LNX_ADD_INST_DIRS)
405
406#
407# .tar.bz2 for converting into .run
408#
409$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
410 $(VBOX_LNX_ADD_ARCH_FILES) \
411 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
412 $(VBOX_VERSION_STAMP)
413 $(call MSG_L1,Packing $@)
414 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
415 $(QUIET)$(MKDIR) -p $(@D)
416 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_INST_DIRS)
417ifdef VBOX_USE_PBZIP2
418 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
419 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
420 LICENSE bin init lib sbin share src \
421 $(if $(filter $(KBUILD_TYPE),debug),debug)
422 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
423else
424 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
425 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
426 LICENSE bin init lib sbin share src \
427 $(if $(filter $(KBUILD_TYPE),debug),debug)
428endif
429 $(QUIET)$(CHMOD) 0644 $@
430
431
432#
433# .tar.bz2 containing the debug information
434#
435$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
436 $(VBOX_LNX_ADD_DBG_FILES) \
437 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
438 $(call MSG_L1,Packing $@)
439 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
440 $(QUIET)$(MKDIR) -p $(@D)
441 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_DBG_DIRS)
442ifdef VBOX_USE_PBZIP2
443 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
444 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
445 bin lib sbin
446 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
447else
448 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
449 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
450 bin lib sbin
451endif
452 $(QUIET)$(CHMOD) 0644 $@
453
454
455#
456# Build the Linux Guest Additions self extracting installer.
457#
458# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
459# any references should be made via variables assigned a know value via := .
460#
461$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
462 $(VBOX_LNX_ADD_ARCHIVES) \
463 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
464 $$(LnxAdd-scripts_2_STAGE_TARGETS) \
465 $(VBOX_VERSION_STAMP)
466 # Remove any archives left over from previous builds so that they don't
467 # end up in our installer as well.
468 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
469 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
470 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
471 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
472 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
473 /bin/sh ./install.sh "\$$0 1> /dev/null"
474
475
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