VirtualBox

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

Last change on this file since 31806 was 31806, checked in by vboxsync, 14 years ago

Linux Additions: be nice to depend builds

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.9 KB
Line 
1# $Id: Makefile.kmk 31806 2010-08-20 08:40:14Z 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_INIT_DIR := $(VBOX_LNX_ADD_INST_OUT_DIR)init/
45
46# Installation paths for debug symbols
47VBOX_LNX_ADD_DBG_BIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)bin/
48VBOX_LNX_ADD_DBG_SBIN_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)sbin/
49VBOX_LNX_ADD_DBG_LIB_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/
50VBOX_LNX_ADD_DBG_MOD_DIR := $(VBOX_LNX_ADD_INST_DBG_DIR)lib/$(VBOX_LNX_ADD_PACKAGE_NAME)/
51
52# Script source directories
53VBOX_PATH_LNX_ADD_INST := $(PATH_SUB_CURRENT)/installer/
54VBOX_REL_LNX_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_ADD_INST))
55VBOX_PATH_X11_ADD_INST := $(PATH_ROOT)/src/VBox/Additions/x11/Installer/
56VBOX_REL_X11_ADD_INST := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_X11_ADD_INST))
57VBOX_PATH_LNX_INST_SRC := $(PATH_ROOT)/src/VBox/Installer/linux/
58VBOX_REL_LNX_INST_SRC := $(subst $(PATH_ROOT)/src/VBox, ../..,$(VBOX_PATH_LNX_INST_SRC))
59
60# Unset this to speed up things during makefile hacking.
61VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
62
63
64#
65# Targets
66#
67VBOX_SELINUX_CMPLD := $(PATH_SUB_CURRENT)/selinux-fedora/vbox_x11.pp
68VBOX_LNX_ADD_ARCHIVE.x86 := $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-x86-r$(VBOX_SVN_REV).tar.bz2
69VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64-r$(VBOX_SVN_REV).tar.bz2
70ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
71 VBOX_LNX_ADD_ARCHIVES := $(PATH_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH)-r$(VBOX_SVN_REV).tar.bz2
72else
73 VBOX_LNX_ADD_ARCHIVES := \
74 $(VBOX_LNX_ADD_ARCHIVE.x86) \
75 $(VBOX_LNX_ADD_ARCHIVE.amd64)
76endif
77BLDDIRS += \
78 $(VBOX_LNX_ADD_INST_OUT_DIR) \
79 $(VBOX_LNX_ADD_INST_BIN_DIR) \
80 $(VBOX_LNX_ADD_INST_SBIN_DIR) \
81 $(VBOX_LNX_ADD_INST_LIB_DIR) \
82 $(VBOX_LNX_ADD_INST_MOD_DIR) \
83 $(VBOX_LNX_ADD_INST_KMOD_DIR) \
84 $(VBOX_LNX_ADD_INST_INIT_DIR) \
85 $(VBOX_LNX_ADD_INST_DBG_DIR) \
86 $(VBOX_LNX_ADD_DBG_BIN_DIR) \
87 $(VBOX_LNX_ADD_DBG_SBIN_DIR) \
88 $(VBOX_LNX_ADD_DBG_LIB_DIR) \
89 $(VBOX_LNX_ADD_DBG_MOD_DIR) \
90 $(VBOX_LNX_ADD_INST_STAGE_DIR)
91# Use VBOX_WITHOUT_LINUX_GUEST_PACKAGE to skip building the .run installer.
92# This will only take effect if you also use VBOX_WITHOUT_ADDITIONS_ISO.
93PACKING += \
94 $(if-expr !defined(VBOX_WITHOUT_LINUX_GUEST_PACKAGE), $(PATH_BIN)/additions/VBoxLinuxAdditions.run,) \
95 $(VBOX_LNX_ADD_ARCHIVES) \
96 $(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2
97OTHER_CLEAN += \
98 $(PACKING) \
99 $(foreach file, $(VBOX_LNX_ADD_ARCHIVES), $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file))))
100
101
102#
103# Files to install
104#
105VBOX_ADD_STRIP_BIN += \
106 VBoxControl
107
108VBOX_ADD_STRIP_BIN.linux += \
109 VBoxClient
110
111VBOX_ADD_BIN.linux += \
112 VBoxClient-all
113
114VBOX_ADD_STRIP_SBIN += \
115 VBoxService
116
117VBOX_ADD_STRIP_LIB += \
118 VBoxOGLarrayspu.so \
119 VBoxOGLcrutil.so \
120 VBoxOGLerrorspu.so \
121 VBoxOGLfeedbackspu.so \
122 VBoxOGLpackspu.so \
123 VBoxOGLpassthroughspu.so \
124 VBoxOGL.so
125
126VBOX_ADD_STRIP_MOD.linux = \
127 vboxmouse_drv_70.so \
128 vboxmouse_drv_71.so \
129 vboxmouse_drv_13.so \
130 vboxmouse_drv_14.so \
131 vboxmouse_drv_15.so \
132 vboxmouse_drv_16.so \
133 vboxmouse_drv_17.so \
134 vboxmouse_drv_18.so \
135 vboxvideo_drv_70.so \
136 vboxvideo_drv_71.so \
137 vboxvideo_drv_13.so \
138 vboxvideo_drv_14.so \
139 vboxvideo_drv_15.so \
140 vboxvideo_drv_16.so \
141 vboxvideo_drv_17.so \
142 vboxvideo_drv_18.so \
143 pam_vbox.so \
144 mount.vboxsf
145
146VBOX_ADD_MOD.linux = \
147 98vboxadd-xclient \
148 x11config-new.pl
149
150VBOX_ADD_STRIP_OBJ.linux = \
151 vboxmouse_drv.o \
152 vboxvideo_drv.o
153
154VBOX_ADD_KMOD = \
155 vboxguest
156
157VBOX_ADD_KMOD.linux = \
158 vboxsf \
159 vboxvideo
160
161VBOX_ADD_INIT.linux = \
162 vboxadd \
163 vboxadd-service \
164 vboxadd-x11
165
166VBOX_LNX_ADD_STRIP_BIN = $(VBOX_ADD_STRIP_BIN) $(VBOX_ADD_STRIP_BIN.linux)
167VBOX_LNX_ADD_BIN = $(VBOX_ADD_BIN) $(VBOX_ADD_BIN.linux)
168VBOX_LNX_ADD_STRIP_SBIN= $(VBOX_ADD_STRIP_SBIN) $(VBOX_ADD_STRIP_SBIN.linux)
169VBOX_LNX_ADD_STRIP_LIB = $(VBOX_ADD_STRIP_LIB) $(VBOX_ADD_STRIP_LIB.linux)
170VBOX_LNX_ADD_STRIP_MOD = $(VBOX_ADD_STRIP_MOD) $(VBOX_ADD_STRIP_MOD.linux)
171VBOX_LNX_ADD_MOD = $(VBOX_ADD_MOD) $(VBOX_ADD_MOD.linux)
172VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
173VBOX_LNX_ADD_KMOD = $(VBOX_ADD_KMOD) $(VBOX_ADD_KMOD.linux)
174VBOX_LNX_ADD_INIT = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
175
176VBOX_LNX_ADD_KMOD_VERSIONED := $(addsuffix -$(VBOX_VERSION_STRING),$(VBOX_LNX_ADD_KMOD))
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_VERSIONED)) \
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
193VBOX_LNX_ADD_DBG_FILES := \
194 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
195 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
196 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
197 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
198
199# Cleanup of the the installer directory files
200OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DEBUG_FILES)
201
202# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
203$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
204 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
205 $(call MSG_TOOL,copydbg,$<,$@)
206 $(QUIET)objcopy --only-keep-debug $< $@
207
208$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
209 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
210 $(call MSG_TOOL,copydbg,$<,$@)
211 $(QUIET)objcopy --only-keep-debug $< $@
212
213$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
214 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
215 $(call MSG_TOOL,copydbg,$<,$@)
216 $(QUIET)objcopy --only-keep-debug $< $@
217
218$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
219 $(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
220 $(call MSG_TOOL,copydbg,$<,$@)
221 $(QUIET)objcopy --only-keep-debug $< $@
222
223# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
224$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
225 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_BIN)/additions/% \
226 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
227 | $$(dir $$@)
228 $(call MSG_INST_FILE,$<,$@)
229 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
230 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
231
232# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
233$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
234 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_BIN)/additions/% \
235 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
236 | $$(dir $$@)
237 $(call MSG_INST_FILE,$<,$@)
238 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
239 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
240
241# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
242$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
243 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_BIN)/additions/% \
244 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
245 | $$(dir $$@)
246 $(call MSG_INST_FILE,$<,$@)
247 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
248 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
249
250# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
251$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
252 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% \
253 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
254 | $$(dir $$@)
255 $(call MSG_INST_FILE,$<,$@)
256 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
257 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
258
259# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
260$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
261 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
262 $(call MSG_INST_FILE,$<,$@)
263ifeq ($(VBOX_DO_STRIP),)
264 $(QUIET)$(INSTALL) -m 0644 $< $@
265else # strip to temp file because of umask.
266 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
267 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
268 $(QUIET)$(RM) -f -- [email protected]
269endif
270
271# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
272$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_VERSIONED)): \
273 $(VBOX_LNX_ADD_INST_KMOD_DIR)%-$(VBOX_VERSION_STRING) : $(PATH_BIN)/additions/src/% | $(VBOX_LNX_ADD_INST_KMOD_DIR)
274 $(call MSG_INST_DIR,$<,$@)
275# Remove target directories first, otherwise the behaviour of cp will not be
276# what we want if it already exists. See the cp manual page for more details.
277 $(QUIET)$(RM) -Rf $@
278 $(QUIET)cp -af $< $@
279
280# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
281$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
282 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
283 $(call MSG_INST_FILE,$<,$@)
284# Remove target directories first, otherwise the behaviour of cp will not be
285# what we want if it already exists. See the cp manual page for more details.
286 $(QUIET)$(RM) -Rf $@
287 $(QUIET)cp -af $< $@
288
289# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
290$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
291 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
292 $(call MSG_INST_FILE,$<,$@)
293# Remove target directories first, otherwise the behaviour of cp will not be
294# what we want if it already exists. See the cp manual page for more details.
295 $(QUIET)$(RM) -Rf $@
296 $(QUIET)cp -af $< $@
297
298
299INSTALLS += GuestDrivers-src
300GuestDrivers-src_INST = bin/additions/src/
301GuestDrivers-src_MODE = a+r,u+w
302GuestDrivers-src_SOURCES = Makefile
303
304
305INSTALLS += lnx_add_inst-exec
306lnx_add_inst-exec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_MOD_DIR))
307lnx_add_inst-exec_MODE = a+rx,u+w
308lnx_add_inst-exec_SOURCES = \
309 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
310 $(VBOX_REL_X11_ADD_INST)x11config-new.pl
311
312
313INSTALLS += lnx_add_inst-noexec
314lnx_add_inst-noexec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/
315lnx_add_inst-noexec_MODE = a+r,u+w
316lnx_add_inst-noexec_SOURCES = \
317 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
318 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
319 $(VBOX_REL_X11_ADD_INST)50-vboxmouse.conf \
320 $(VBOX_REL_LNX_ADD_INST)70-xorg-vboxmouse.rules \
321 $(VBOX_REL_LNX_ADD_INST)90-vboxguest.fdi \
322 selinux-fedora/vbox_x11.pp
323
324
325INSTALLS += AutoRun-sh
326AutoRun-sh_INST = bin/additions/
327AutoRun-sh_MODE = a+rx,u+w
328AutoRun-sh_SOURCES = $(VBOX_REL_LNX_ADD_INST)autorun.sh
329
330
331#
332# Install the sources of our (sanity) test kernel module
333#
334INSTALLS += LnxAddTest-src
335LnxAddTest-src_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test/
336LnxAddTest-src_MODE = a+r,u+w
337LnxAddTest-src_SOURCES = \
338 $(VBOX_REL_LNX_ADD_INST)Makefile.test=>Makefile \
339 ../../HostDrivers/linux/build_in_tmp \
340 $(VBOX_REL_LNX_ADD_INST)test.c
341
342
343#
344# Install the sources of our (sanity) test kernel rendering (DRM) module
345#
346INSTALLS += LnxAddDRM-src
347LnxAddDRM-src_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test_drm/
348LnxAddDRM-src_MODE = a+r,u+w
349LnxAddDRM-src_SOURCES = \
350 $(VBOX_REL_LNX_ADD_INST)Makefile.include.header \
351 $(VBOX_REL_LNX_ADD_INST)Makefile.include.footer \
352 $(VBOX_REL_LNX_ADD_INST)Makefile.test.drm=>Makefile \
353 ../../HostDrivers/linux/build_in_tmp \
354 $(VBOX_REL_LNX_ADD_INST)test_drm.c
355
356
357#
358# We need our routines.sh and the uninstallation scripts in the staging
359# directory too
360#
361INSTALLS += LnxAdd-scripts
362LnxAdd-scripts_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
363LnxAdd-scripts_MODE = a+rx,u+w
364LnxAdd-scripts_SOURCES = \
365 $(VBOX_REL_LNX_INST_SRC)routines.sh \
366 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
367 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
368 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
369 $(VBOX_REL_LNX_ADD_INST)deffiles
370
371
372#
373# VBoxClient-all
374#
375INSTALLS += LnxAdd-Nostrip-Bin
376LnxAdd-Nostrip-Bin_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
377LnxAdd-Nostrip-Bin_MODE = a+rx,u+w
378LnxAdd-Nostrip-Bin_SOURCES = \
379 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
380
381
382#
383# And the init scripts
384#
385INSTALLS += LnxAdd-init-scripts
386LnxAdd-init-scripts_INST = bin/additions
387LnxAdd-init-scripts_MODE = a+rx,u+w
388LnxAdd-init-scripts_SOURCES = \
389 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
390
391
392# this file needs editing before it can be included in the generic installer.
393$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
394 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
395 $(QUIET)$(SED) \
396 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
397 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
398 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
399 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
400 -e "s;_BUILD_;$(shell date);g" \
401 -e "s;_OSE_;$(VBOX_OSE);g" \
402 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
403 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
404 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxadd-timesync vboxadd-service vboxadd;g" \
405 --output $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
406 $<
407 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh $@
408 $(QUIET)$(RM) $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh
409OTHERS_CLEAN += \
410 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
411 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
412
413
414include $(KBUILD_PATH)/subfooter.kmk
415
416
417# All the files that go into our archive
418VBOX_LNX_ADD_ARCH_FILES = \
419 $(INSTARGET_lnx_add_inst-noexec) \
420 $(INSTARGET_lnx_add_inst-exec) \
421 $(INSTARGET_LnxAddTest-src) \
422 $(INSTARGET_LnxAddDRM-src) \
423 $(VBOX_LNX_ADD_INST_FILES)
424
425#
426# .tar.bz2 for converting into .run
427#
428$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
429 $(VBOX_LNX_ADD_ARCH_FILES) \
430 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
431 $(VBOX_VERSION_STAMP)
432 $(call MSG_L1,Packing $@)
433 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
434 $(QUIET)$(MKDIR) -p $(@D)
435ifdef VBOX_USE_PBZIP2
436 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
437 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
438 bin init lib sbin share src \
439 $(if $(filter $(KBUILD_TYPE),debug),debug)
440 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
441else
442 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
443 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
444 bin init lib sbin share src \
445 $(if $(filter $(KBUILD_TYPE),debug),debug)
446endif
447 $(QUIET)$(CHMOD) 0644 $@
448
449
450#
451# .tar.bz2 containing the debug information
452#
453$(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
454 $(VBOX_LNX_ADD_DBG_FILES) \
455 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
456 $(call MSG_L1,Packing $@)
457 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
458 $(QUIET)$(MKDIR) -p $(@D)
459ifdef VBOX_USE_PBZIP2
460 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
461 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
462 bin lib sbin
463 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
464else
465 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
466 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
467 bin lib sbin
468endif
469 $(QUIET)$(CHMOD) 0644 $@
470
471
472#
473# Build the Linux Guest Additions self extracting installer.
474#
475# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
476# any references should be made via variables assigned a know value via := .
477#
478$(PATH_BIN)/additions/VBoxLinuxAdditions.run: \
479 $(VBOX_LNX_ADD_ARCHIVES) \
480 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
481 $$(INSTARGET_LnxAdd-scripts) \
482 $(VBOX_VERSION_STAMP)
483 # Remove any archives left over from previous builds so that they don't
484 # end up in our installer as well.
485 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
486 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
487 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
488 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
489 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
490 /bin/sh ./install.sh "\$$0 1> /dev/null"
491
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