VirtualBox

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

Last change on this file since 63877 was 63877, checked in by vboxsync, 8 years ago

bugref:3809: Linux installer maintenance: Additions installer small clean-ups.

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