VirtualBox

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

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

Additions/linux/installer: shell script refactoring

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