VirtualBox

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

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

Additions/linux: correctly set the build type (release, debug) when building the kernel modules

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.8 KB
Line 
1# $Id: Makefile.kmk 32590 2010-09-17 11:24:09Z 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_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_BIN)/additions/VBoxLinuxAdditions.run,) \
97 $(VBOX_LNX_ADD_ARCHIVES) \
98 $(PATH_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 vboxvideo_drv_70.so \
139 vboxvideo_drv_71.so \
140 vboxvideo_drv_13.so \
141 vboxvideo_drv_14.so \
142 vboxvideo_drv_15.so \
143 vboxvideo_drv_16.so \
144 vboxvideo_drv_17.so \
145 vboxvideo_drv_18.so \
146 vboxvideo_drv_19.so \
147 pam_vbox.so \
148 mount.vboxsf
149
150VBOX_ADD_MOD.linux = \
151 98vboxadd-xclient \
152 x11config-new.pl
153
154VBOX_ADD_STRIP_OBJ.linux = \
155 vboxmouse_drv.o \
156 vboxvideo_drv.o
157
158VBOX_ADD_KMOD = \
159 $(addprefix vboxguest-$(VBOX_VERSION_STRING)/,\
160 vboxguest vboxsf vboxvideo Makefile dkms.conf do_dkms)
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 = $(VBOX_ADD_KMOD)
175VBOX_LNX_ADD_INIT = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
176
177#
178# All the files that go into the archive
179#
180VBOX_LNX_ADD_INST_FILES := \
181 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
182 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_BIN)) \
183 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
184 $(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
185 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
186 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
187 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
188 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)) \
189 $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
190 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
191
192VBOX_LNX_ADD_DBG_FILES := \
193 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
194 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
195 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
196 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
197
198# Cleanup of the the installer directory files
199OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DBG_FILES)
200
201# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
202$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
203 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
204 $(call MSG_TOOL,copydbg,$<,$@)
205 $(QUIET)objcopy --only-keep-debug $< $@
206
207$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
208 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
209 $(call MSG_TOOL,copydbg,$<,$@)
210 $(QUIET)objcopy --only-keep-debug $< $@
211
212$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
213 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
214 $(call MSG_TOOL,copydbg,$<,$@)
215 $(QUIET)objcopy --only-keep-debug $< $@
216
217$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
218 $(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
219 $(call MSG_TOOL,copydbg,$<,$@)
220 $(QUIET)objcopy --only-keep-debug $< $@
221
222# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
223$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
224 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_BIN)/additions/% \
225 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
226 | $$(dir $$@)
227 $(call MSG_INST_FILE,$<,$@)
228 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
229 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
230
231# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
232$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
233 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_BIN)/additions/% \
234 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
235 | $$(dir $$@)
236 $(call MSG_INST_FILE,$<,$@)
237 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
238 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
239
240# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
241$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
242 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_BIN)/additions/% \
243 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
244 | $$(dir $$@)
245 $(call MSG_INST_FILE,$<,$@)
246 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
247 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
248
249# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
250$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
251 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% \
252 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
253 | $$(dir $$@)
254 $(call MSG_INST_FILE,$<,$@)
255 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
256 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
257
258# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
259$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
260 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
261 $(call MSG_INST_FILE,$<,$@)
262ifeq ($(VBOX_DO_STRIP),)
263 $(QUIET)$(INSTALL) -m 0644 $< $@
264else # strip to temp file because of umask.
265 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
266 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
267 $(QUIET)$(RM) -f -- $@.tmp
268endif
269
270# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
271$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD)): \
272 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : $(PATH_BIN)/additions/src/% | $$(dir $$@)
273 $(call MSG_INST_DIR,$<,$@)
274 $(QUIET)$(RM) -Rf $@
275 $(QUIET)cp -af $< $@
276
277# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
278$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
279 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
280 $(call MSG_INST_FILE,$<,$@)
281# Remove target directories first, otherwise the behaviour of cp will not be
282# what we want if it already exists. See the cp manual page for more details.
283 $(QUIET)$(RM) -Rf $@
284 $(QUIET)cp -af $< $@
285
286# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
287$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
288 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_BIN)/additions/% | $$(dir $$@)
289 $(call MSG_INST_FILE,$<,$@)
290# Remove target directories first, otherwise the behaviour of cp will not be
291# what we want if it already exists. See the cp manual page for more details.
292 $(QUIET)$(RM) -Rf $@
293 $(QUIET)cp -af $< $@
294
295
296INSTALLS += GuestDrivers-src
297GuestDrivers-src_INST = bin/additions/src/
298GuestDrivers-src_MODE = a+r,u+w
299GuestDrivers-src_SOURCES = Makefile
300
301
302INSTALLS += lnx_add_inst-exec
303lnx_add_inst-exec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_MOD_DIR))
304lnx_add_inst-exec_MODE = a+rx,u+w
305lnx_add_inst-exec_SOURCES = \
306 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
307 $(VBOX_REL_X11_ADD_INST)x11config-new.pl
308
309
310INSTALLS += lnx_add_inst-noexec
311lnx_add_inst-noexec_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/
312lnx_add_inst-noexec_MODE = a+r,u+w
313lnx_add_inst-noexec_SOURCES = \
314 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
315 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
316 $(VBOX_REL_X11_ADD_INST)50-vboxmouse.conf \
317 $(VBOX_REL_LNX_ADD_INST)70-xorg-vboxmouse.rules \
318 $(VBOX_REL_LNX_ADD_INST)90-vboxguest.fdi \
319 selinux-fedora/vbox_x11.pp
320
321
322INSTALLS += AutoRun-sh
323AutoRun-sh_INST = bin/additions/
324AutoRun-sh_MODE = a+rx,u+w
325AutoRun-sh_SOURCES = $(VBOX_REL_LNX_ADD_INST)autorun.sh
326
327
328#
329# Install the sources of our (sanity) test kernel module
330#
331INSTALLS += LnxAddTest-src
332LnxAddTest-src_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test/
333LnxAddTest-src_MODE = a+r,u+w
334LnxAddTest-src_SOURCES = \
335 $(VBOX_REL_LNX_ADD_INST)Makefile.test=>Makefile \
336 $(PATH_BIN)/additions/src/vboxguest/build_in_tmp \
337 $(VBOX_REL_LNX_ADD_INST)test.c
338
339
340#
341# Install the sources of our (sanity) test kernel rendering (DRM) module
342#
343INSTALLS += LnxAddDRM-src
344LnxAddDRM-src_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME))/test_drm/
345LnxAddDRM-src_MODE = a+r,u+w
346LnxAddDRM-src_SOURCES = \
347 $(VBOX_REL_LNX_ADD_INST)Makefile.include.header \
348 $(VBOX_REL_LNX_ADD_INST)Makefile.include.footer \
349 $(VBOX_REL_LNX_ADD_INST)Makefile.test.drm=>Makefile \
350 $(PATH_BIN)/additions/src/vboxguest/build_in_tmp \
351 $(VBOX_REL_LNX_ADD_INST)test_drm.c
352
353
354#
355# We need our routines.sh and the uninstallation scripts in the staging
356# directory too
357#
358INSTALLS += LnxAdd-scripts
359LnxAdd-scripts_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_STAGE_DIR))
360LnxAdd-scripts_MODE = a+rx,u+w
361LnxAdd-scripts_SOURCES = \
362 $(VBOX_REL_LNX_INST_SRC)routines.sh \
363 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
364 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
365 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
366 $(VBOX_REL_LNX_ADD_INST)deffiles
367
368
369#
370# VBoxClient-all
371#
372INSTALLS += LnxAdd-Nostrip-Bin
373LnxAdd-Nostrip-Bin_INST = $(subst $(PATH_TARGET),obj,$(VBOX_LNX_ADD_INST_BIN_DIR))
374LnxAdd-Nostrip-Bin_MODE = a+rx,u+w
375LnxAdd-Nostrip-Bin_SOURCES = \
376 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
377
378
379#
380# And the init scripts
381#
382INSTALLS += LnxAdd-init-scripts
383LnxAdd-init-scripts_INST = bin/additions
384LnxAdd-init-scripts_MODE = a+rx,u+w
385LnxAdd-init-scripts_SOURCES = \
386 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
387
388
389# this file needs editing before it can be included in the generic installer.
390$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
391 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
392 $(QUIET)$(SED) \
393 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
394 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
395 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
396 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
397 -e "s;_BUILD_;$(shell date);g" \
398 -e "s;_OSE_;$(VBOX_OSE);g" \
399 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
400 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
401 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxadd-timesync vboxadd-service vboxadd;g" \
402 --output $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
403 $<
404 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh $@
405 $(QUIET)$(RM) $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh
406OTHER_CLEAN += \
407 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
408 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
409
410
411include $(KBUILD_PATH)/subfooter.kmk
412
413
414# All the files that go into our archive
415VBOX_LNX_ADD_ARCH_FILES = \
416 $(INSTARGET_lnx_add_inst-noexec) \
417 $(INSTARGET_lnx_add_inst-exec) \
418 $(INSTARGET_LnxAddTest-src) \
419 $(INSTARGET_LnxAddDRM-src) \
420 $(VBOX_LNX_ADD_INST_FILES)
421
422#
423# .tar.bz2 for converting into .run
424#
425$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
426 $(VBOX_LNX_ADD_ARCH_FILES) \
427 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
428 $(VBOX_VERSION_STAMP)
429 $(call MSG_L1,Packing $@)
430 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
431 $(QUIET)$(MKDIR) -p $(@D)
432ifdef VBOX_USE_PBZIP2
433 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
434 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
435 bin init lib sbin share src \
436 $(if $(filter $(KBUILD_TYPE),debug),debug)
437 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
438else
439 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
440 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
441 bin init lib sbin share src \
442 $(if $(filter $(KBUILD_TYPE),debug),debug)
443endif
444 $(QUIET)$(CHMOD) 0644 $@
445
446
447#
448# .tar.bz2 containing the debug information
449#
450$(PATH_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
451 $(VBOX_LNX_ADD_DBG_FILES) \
452 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
453 $(call MSG_L1,Packing $@)
454 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
455 $(QUIET)$(MKDIR) -p $(@D)
456ifdef VBOX_USE_PBZIP2
457 $(QUIET)tar --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
458 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
459 bin lib sbin
460 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
461else
462 $(QUIET)tar --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
463 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
464 bin lib sbin
465endif
466 $(QUIET)$(CHMOD) 0644 $@
467
468
469#
470# Build the Linux Guest Additions self extracting installer.
471#
472# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
473# any references should be made via variables assigned a know value via := .
474#
475$(PATH_BIN)/additions/VBoxLinuxAdditions.run: \
476 $(VBOX_LNX_ADD_ARCHIVES) \
477 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
478 $$(INSTARGET_LnxAdd-scripts) \
479 $(VBOX_VERSION_STAMP)
480 # Remove any archives left over from previous builds so that they don't
481 # end up in our installer as well.
482 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
483 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
484 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
485 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
486 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
487 /bin/sh ./install.sh "\$$0 1> /dev/null"
488
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