VirtualBox

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

Last change on this file since 95911 was 95882, checked in by vboxsync, 2 years ago

tools/Makefile.kmk,Additions/linux/Makefile.kmk: Update the makeself tool to handle tar commands too old to support the --format option (linux.x86 build environment). This patches makeself to add a new command line option disabling the use of --format, bugref:8515

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.5 KB
Line 
1# $Id: Makefile.kmk 95882 2022-07-27 18:48:23Z vboxsync $
2## @file
3# Makefile for the linux guest additions base directory.
4#
5
6#
7# Copyright (C) 2006-2022 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#
32# Globals
33#
34
35# Basic path components
36VBOX_LNX_ADD_PACKAGE_NAME := VBoxGuestAdditions
37VBOX_LNX_ADD_INST_OUT_DIR := $(PATH_TARGET)/Additions/Installer/linux/
38VBOX_LNX_ADD_INST_DBG_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)debug/
39VBOX_LNX_ADD_INST_STAGE_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)install/
40
41# Installation paths for binaries and files
42VBOX_LNX_ADD_INST_BIN_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)bin/
43VBOX_LNX_ADD_INST_SBIN_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)sbin/
44VBOX_LNX_ADD_INST_LIB_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)lib/
45VBOX_LNX_ADD_INST_OTHER_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)other/
46VBOX_LNX_ADD_INST_KMOD_DIR_BASE := $(VBOX_LNX_ADD_INST_OUT_DIR)src/
47# This is a symbolic link, so no trailing slash.
48VBOX_LNX_ADD_INST_KMOD_PATH := $(VBOX_LNX_ADD_INST_KMOD_DIR_BASE)vboxguest-$(VBOX_VERSION_STRING)
49VBOX_LNX_ADD_INST_INIT_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)init/
50
51VBOX_LNX_ADD_ARCH_INST_DIRS := \
52 $(VBOX_LNX_ADD_INST_OUT_DIR) \
53 $(VBOX_LNX_ADD_INST_BIN_DIR) \
54 $(VBOX_LNX_ADD_INST_SBIN_DIR) \
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_OTHER_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)other/
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_OTHER_DIR)
67
68# Script source directories
69VBOX_PATH_LNX_ADD_INST := $(PATH_SUB_CURRENT)/installer/
70VBOX_REL_LNX_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_ADD_INST))
71VBOX_PATH_X11_ADD_INST := $(PATH_ROOT)/src/VBox/Additions/x11/Installer/
72VBOX_REL_X11_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_X11_ADD_INST))
73VBOX_PATH_LNX_INST_SRC := $(PATH_ROOT)/src/VBox/Installer/linux/
74VBOX_REL_LNX_INST_SRC := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_INST_SRC))
75VBOX_PATH_LNX_HOST_DRV := $(PATH_ROOT)/src/VBox/HostDrivers/linux/
76VBOX_REL_LNX_HOST_DRV := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_HOST_DRV))
77
78# Unset this to speed up things during makefile hacking.
79VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
80
81
82#
83# Targets
84#
85VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
86VBOX_LNX_ADD_ARCHIVE.x86 := $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-x86.tar.bz2
87VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64.tar.bz2
88ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
89 VBOX_LNX_ADD_ARCHIVES := $(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH).tar.bz2
90else
91 VBOX_LNX_ADD_ARCHIVES := \
92 $(VBOX_LNX_ADD_ARCHIVE.x86) \
93 $(VBOX_LNX_ADD_ARCHIVE.amd64)
94endif
95BLDDIRS += \
96 $(VBOX_LNX_ADD_ARCH_INST_DIRS) \
97 $(VBOX_LNX_ADD_DBG_DIRS) \
98 $(VBOX_LNX_ADD_INST_STAGE_DIR)
99
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 $(VBOX_LNX_ADD_INST_KMOD_PATH) \
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_LNX_ADD_STRIP_BIN += \
116 VBoxControl \
117 VBoxDRMClient \
118 VBoxClient
119ifdef VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
120 VBOX_LNX_ADD_STRIP_BIN += \
121 VBoxAudioTest
122endif
123
124VBOX_LNX_ADD_STRIP_SBIN += \
125 VBoxService \
126 $(if $(VBOX_WITH_LIGHTDM_GREETER),vbox-greeter)
127
128VBOX_LNX_ADD_STRIP_MOD = \
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 $(addsuffix .so,$(filter-out %_32,$(filter vboxvideo_drv_%,$(DLLS)))) \
136 $(if $(VBOX_WITH_PAM),pam_vbox.so,) \
137 mount.vboxsf
138
139VBOX_LNX_ADD_MOD = \
140 98vboxadd-xclient \
141 x11config.sh
142
143VBOX_LNX_ADD_STRIP_OBJ = \
144 vboxmouse_drv.o \
145 vboxvideo_drv.o
146
147VBOX_LNX_ADD_INIT = \
148 vboxadd \
149 vboxadd-service \
150 vboxadd-x11
151
152#
153# All the files that go into the archive
154#
155VBOX_LNX_ADD_INST_FILES := \
156 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
157 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_BIN)) \
158 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
159 $(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
160 $(addprefix $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
161 $(addprefix $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_MOD)) \
162 $(addprefix $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
163 $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT))
164
165VBOX_LNX_ADD_DBG_FILES := \
166 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
167 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
168 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
169 $(addprefix $(VBOX_LNX_ADD_DBG_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
170
171ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
172VBOX_LNX_ADD_INST_FILES += \
173 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter)
174endif
175
176# Cleanup of the installer directory files
177OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DBG_FILES)
178
179# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
180$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
181 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
182 $(call MSG_TOOL,copydbg,$<,$@)
183 $(QUIET)objcopy --only-keep-debug $< $@
184
185$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
186 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
187 $(call MSG_TOOL,copydbg,$<,$@)
188 $(QUIET)objcopy --only-keep-debug $< $@
189
190$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
191 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
192 $(call MSG_TOOL,copydbg,$<,$@)
193 $(QUIET)objcopy --only-keep-debug $< $@
194
195$(addprefix $(VBOX_LNX_ADD_DBG_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
196 $(VBOX_LNX_ADD_DBG_OTHER_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
197 $(call MSG_TOOL,copydbg,$<,$@)
198 $(QUIET)objcopy --only-keep-debug $< $@
199
200# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
201$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
202 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
203 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
204 | $$(dir $$@)
205 $(call MSG_INST_FILE,$<,$@)
206 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
207 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_DBG_BIN_DIR),$@) $@
208
209# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
210$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),\
211 $(filter-out vbox-greeter,$(VBOX_LNX_ADD_STRIP_SBIN))): \
212 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
213 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
214 | $$(dir $$@)
215 $(call MSG_INST_FILE,$<,$@)
216 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
217 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_DBG_SBIN_DIR),$@) $@
218
219# pattern rule for stripping and copying vbox-greeter to the installation directory
220$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter): \
221 $(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/% \
222 | $$(dir $$@)
223 $(call MSG_INST_FILE,$<,$@)
224 $(QUIET)$(INSTALL) -m 0755 $< $@
225
226# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
227$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
228 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% \
229 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
230 | $$(dir $$@)
231 $(call MSG_INST_FILE,$<,$@)
232 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
233 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_DBG_LIB_DIR),$@) $@
234
235# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
236$(addprefix $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
237 $(VBOX_LNX_ADD_INST_OTHER_DIR)% : $(PATH_STAGE_BIN)/additions/% \
238 $(VBOX_LNX_ADD_DBG_OTHER_DIR)% \
239 | $$(dir $$@)
240 $(call MSG_INST_FILE,$<,$@)
241 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
242 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_DBG_OTHER_DIR),$@) $@
243
244# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
245$(addprefix $(VBOX_LNX_ADD_INST_OTHER_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
246 $(VBOX_LNX_ADD_INST_OTHER_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
247 $(call MSG_INST_FILE,$<,$@)
248ifeq ($(VBOX_DO_STRIP),)
249 $(QUIET)$(INSTALL) -m 0644 $< $@
250else # strip to temp file because of umask.
251 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
252 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
253 $(QUIET)$(RM) -f -- $@.tmp
254endif
255
256include $(PATH_ROOT)/src/VBox/Additions/common/VBoxGuest/linux/files_vboxguest
257VBOX_LNX_ADD_INST_FILES_VBOXGUEST=$(patsubst =>%,$(PATH_STAGE_BIN)/additions/src/vboxguest/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXGUEST_NOBIN)))))
258include $(PATH_ROOT)/src/VBox/Additions/linux/sharedfolders/files_vboxsf
259VBOX_LNX_ADD_INST_FILES_VBOXSF=$(patsubst =>%,$(PATH_STAGE_BIN)/additions/src/vboxsf/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXSF_NOBIN)))))
260include $(PATH_ROOT)/src/VBox/Additions/linux/drm/files_vboxvideo_drv
261VBOX_LNX_ADD_INST_FILES_VBOXVIDEO=$(patsubst =>%,$(PATH_STAGE_BIN)/additions/src/vboxvideo/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXVIDEO_DRM_NOBIN)))))
262
263# special rule for the kernel modules
264$(VBOX_LNX_ADD_INST_KMOD_DIR_BASE): \
265 $(PATH_STAGE_BIN)/additions/src/ \
266 $(PATH_ROOT)/Version.kmk \
267 | $(dir $@)
268 $(call MSG_INST_SYM,$<,$@)
269 $(QUIET)$(RM) -Rf $@
270 $(QUIET)$(MKDIR) $@
271 $(QUIET)$(LN_SYMLINK) $< $(VBOX_LNX_ADD_INST_KMOD_PATH)
272
273INSTALLS += GuestDrivers-src
274GuestDrivers-src_INST = $(INST_ADDITIONS)src/
275GuestDrivers-src_MODE = a+r,u+w
276GuestDrivers-src_SOURCES = Makefile
277
278
279INSTALLS += lnx_add_inst-exec
280lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_OTHER_DIR)
281lnx_add_inst-exec_INSTTYPE = stage
282lnx_add_inst-exec_EXEC_SOURCES = \
283 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
284 $(VBOX_REL_X11_ADD_INST)x11config.sh \
285 $(VBOX_REL_LNX_INST_SRC)check_module_dependencies.sh
286
287
288INSTALLS += lnx_add_inst-noexec
289lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_OTHER_DIR)
290lnx_add_inst-noexec_INSTTYPE = stage
291lnx_add_inst-noexec_SOURCES = \
292 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
293 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
294 $(if $(VBOX_WITH_LIGHTDM_GREETER_PACKING),lightdm-greeter/vbox-greeter.desktop,) \
295 selinux-fedora/vbox_x11.pp \
296 selinux-fedora/vbox_accel.pp
297
298INSTALLS += lnx_add_inst-license
299lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
300lnx_add_inst-license_INSTTYPE = stage
301lnx_add_inst-license_SOURCES = \
302 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
303
304
305#
306# We need our routines.sh and the uninstallation scripts in the staging
307# directory too
308#
309INSTALLS += LnxAdd-scripts
310LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
311LnxAdd-scripts_INSTTYPE = stage
312LnxAdd-scripts_SOURCES = \
313 $(VBOX_REL_LNX_ADD_INST)deffiles
314LnxAdd-scripts_EXEC_SOURCES = \
315 $(VBOX_REL_LNX_INST_SRC)routines.sh
316
317ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
318 LnxAdd-scripts_EXEC_SOURCES += \
319 $(VBOX_REL_LNX_ADD_INST)module-autologon.sh=>installer/module-autologon
320endif
321
322
323#
324# And the init scripts
325#
326INSTALLS += LnxAdd-init-scripts
327LnxAdd-init-scripts_INST = $(VBOX_LNX_ADD_INST_INIT_DIR)
328LnxAdd-init-scripts_INSTTYPE = stage
329LnxAdd-init-scripts_EXEC_SOURCES = \
330 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
331
332# this file needs editing before it can be included in the generic installer.
333$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
334 $(VBOX_PATH_LNX_ADD_INST)install.sh.in \
335 $(VBOX_VERSION_STAMP) | $$(dir $$@)
336 $(RM) -f -- $@
337 $(QUIET)$(SED) \
338 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
339 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
340 -e "s;_USERNAME_;$(USERNAME);g" \
341 --output $@ \
342 $<
343 $(QUIET)$(CHMOD) 0755 $@
344OTHER_CLEAN += \
345 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
346 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
347
348
349#
350# Build test for the Guest Additions kernel modules (kmk check).
351#
352$(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,vboxvideo-src,,)
353
354
355include $(FILE_KBUILD_SUB_FOOTER)
356
357
358# All the files that go into our archive
359VBOX_LNX_ADD_ARCH_FILES = \
360 $(lnx_add_inst-noexec_2_STAGE_TARGETS) \
361 $(lnx_add_inst-exec_2_STAGE_TARGETS) \
362 $(lnx_add_inst-license_2_STAGE_TARGETS) \
363 $(VBOX_LNX_ADD_INST_FILES) \
364 $(VBOX_LNX_ADD_INST_KMOD_DIR_BASE)
365
366VBOX_LNX_ADD_INST_ARCH_DEPS := \
367 $(VBOX_LNX_ADD_ARCH_FILES) \
368 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
369 $(VBOX_VERSION_STAMP) \
370 $(VBOX_LNX_ADD_INST_FILES_VBOXGUEST) \
371 $(VBOX_LNX_ADD_INST_FILES_VBOXSF) \
372 $(VBOX_LNX_ADD_INST_FILES_VBOXVIDEO)
373
374#
375# .tar.bz2 for converting into .run
376#
377$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
378 $(VBOX_LNX_ADD_INST_ARCH_DEPS)
379 $(call MSG_L1,Packing $@)
380 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
381 $(QUIET)$(MKDIR) -p $(@D)
382 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_ARCH_INST_DIRS)
383ifdef VBOX_USE_PBZIP2
384 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
385 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
386 LICENSE bin init lib other sbin src \
387 $(if $(filter $(KBUILD_TYPE),debug),debug)
388 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
389else
390 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
391 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
392 LICENSE bin init lib other sbin src \
393 $(if $(filter $(KBUILD_TYPE),debug),debug)
394endif
395 $(QUIET)$(CHMOD) 0644 $@
396
397
398#
399# .tar.bz2 containing the debug information
400#
401$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
402 $(VBOX_LNX_ADD_DBG_FILES) \
403 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
404 $(call MSG_L1,Packing $@)
405 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
406 $(QUIET)$(MKDIR) -p $(@D)
407 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_DBG_DIRS)
408ifdef VBOX_USE_PBZIP2
409 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
410 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
411 bin lib sbin
412 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
413else
414 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
415 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
416 bin lib sbin
417endif
418 $(QUIET)$(CHMOD) 0644 $@
419
420
421#
422# Build the Linux Guest Additions self extracting installer.
423#
424# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
425# any references should be made via variables assigned a know value via := .
426#
427$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
428 $(VBOX_LNX_ADD_ARCHIVES) \
429 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
430 $$(LnxAdd-scripts_2_STAGE_TARGETS) \
431 $(VBOX_VERSION_STAMP)
432 # Remove any archives left over from previous builds so that they don't
433 # end up in our installer as well.
434 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
435 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
436 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
437 $(QUIET)$(VBOX_MAKESELF) --nocomp --tar-no-format $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
438 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
439 /bin/sh ./install.sh "\$$0"
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