VirtualBox

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

Last change on this file since 44558 was 44265, checked in by vboxsync, 12 years ago

Backed out r83139.

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