VirtualBox

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

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

INSTARGET -> [12]_STAGE_TARGET.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.2 KB
Line 
1# $Id: Makefile.kmk 38152 2011-07-25 12:19:13Z 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_STAGE_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_STAGE_BIN)/additions/VBoxLinuxAdditions.run,) \
97 $(VBOX_LNX_ADD_ARCHIVES) \
98 $(PATH_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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_STAGE_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 selinux-fedora/vbox_accel.pp
323
324INSTALLS += lnx_add_inst-license
325lnx_add_inst-license_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_OUT_DIR))
326lnx_add_inst-license_MODE = a+r,u+w
327lnx_add_inst-license_SOURCES = \
328 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
329
330
331#
332# We need our routines.sh and the uninstallation scripts in the staging
333# directory too
334#
335INSTALLS += LnxAdd-scripts
336LnxAdd-scripts_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
337LnxAdd-scripts_MODE = a+rx,u+w
338LnxAdd-scripts_SOURCES = \
339 $(VBOX_REL_LNX_INST_SRC)routines.sh \
340 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
341 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
342 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
343 $(VBOX_REL_LNX_ADD_INST)deffiles
344
345
346#
347# VBoxClient-all
348#
349INSTALLS += LnxAdd-Nostrip-Bin
350LnxAdd-Nostrip-Bin_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
351LnxAdd-Nostrip-Bin_MODE = a+rx,u+w
352LnxAdd-Nostrip-Bin_SOURCES = \
353 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
354
355
356#
357# And the init scripts
358#
359INSTALLS += LnxAdd-init-scripts
360LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
361LnxAdd-init-scripts_MODE = a+rx,u+w
362LnxAdd-init-scripts_SOURCES = \
363 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
364
365
366# this file needs editing before it can be included in the generic installer.
367$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
368 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
369 $(QUIET)$(SED) \
370 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
371 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
372 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
373 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
374 -e "s;_BUILD_;$(shell date);g" \
375 -e "s;_OSE_;$(VBOX_OSE);g" \
376 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
377 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
378 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxadd-timesync vboxadd-service vboxadd;g" \
379 --output $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
380 $<
381 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh $@
382 $(QUIET)$(RM) $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh
383OTHER_CLEAN += \
384 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
385 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
386
387
388include $(KBUILD_PATH)/subfooter.kmk
389
390
391# All the files that go into our archive
392VBOX_LNX_ADD_ARCH_FILES = \
393 $(lnx_add_inst-noexec_2_STAGE_TARGET) \
394 $(lnx_add_inst-exec_2_STAGE_TARGET) \
395 $(lnx_add_inst-license_2_STAGE_TARGET) \
396 $(LnxAddTest-src_2_STAGE_TARGET) \
397 $(LnxAddDRM-src_2_STAGE_TARGET) \
398 $(VBOX_LNX_ADD_INST_FILES)
399
400#
401# .tar.bz2 for converting into .run
402#
403$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
404 $(VBOX_LNX_ADD_ARCH_FILES) \
405 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
406 $(VBOX_VERSION_STAMP)
407 $(call MSG_L1,Packing $@)
408 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
409 $(QUIET)$(MKDIR) -p $(@D)
410ifdef VBOX_USE_PBZIP2
411 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
412 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
413 LICENSE bin init lib sbin share src \
414 $(if $(filter $(KBUILD_TYPE),debug),debug)
415 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
416else
417 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
418 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
419 LICENSE bin init lib sbin share src \
420 $(if $(filter $(KBUILD_TYPE),debug),debug)
421endif
422 $(QUIET)$(CHMOD) 0644 $@
423
424
425#
426# .tar.bz2 containing the debug information
427#
428$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
429 $(VBOX_LNX_ADD_DBG_FILES) \
430 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
431 $(call MSG_L1,Packing $@)
432 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
433 $(QUIET)$(MKDIR) -p $(@D)
434ifdef VBOX_USE_PBZIP2
435 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
436 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
437 bin lib sbin
438 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
439else
440 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
441 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
442 bin lib sbin
443endif
444 $(QUIET)$(CHMOD) 0644 $@
445
446
447#
448# Build the Linux Guest Additions self extracting installer.
449#
450# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
451# any references should be made via variables assigned a know value via := .
452#
453$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
454 $(VBOX_LNX_ADD_ARCHIVES) \
455 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
456 $$(LnxAdd-scripts_2_STAGE_TARGET) \
457 $(VBOX_VERSION_STAMP)
458 # Remove any archives left over from previous builds so that they don't
459 # end up in our installer as well.
460 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
461 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
462 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
463 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
464 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
465 /bin/sh ./install.sh "\$$0 1> /dev/null"
466
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