VirtualBox

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

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

Installers/linux: make do_dkms take arguments instead of requiring patching.

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