VirtualBox

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

Last change on this file since 43643 was 43323, checked in by vboxsync, 12 years ago

Additions/linux/installer: fix makefile dependencies.

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