VirtualBox

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

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

scm copyright and license note update

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