VirtualBox

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

Last change on this file since 58129 was 57969, checked in by vboxsync, 9 years ago

Installers/linux: drop DKMS support.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.9 KB
Line 
1# $Id: Makefile.kmk 57969 2015-09-30 14:48:47Z vboxsync $
2## @file
3# Makefile for the linux guest additions base directory.
4#
5
6#
7# Copyright (C) 2006-2015 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.tar.bz2
91VBOX_LNX_ADD_ARCHIVE.amd64 := $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions/VBoxGuestAdditions-amd64.tar.bz2
92ifndef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
93 VBOX_LNX_ADD_ARCHIVES := $(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-$(KBUILD_TARGET_ARCH).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_STRIP_SBIN += \
125 VBoxService \
126 $(if $(VBOX_WITH_LIGHTDM_GREETER),vbox-greeter)
127
128ifdef VBOX_WITH_CROGL
129VBOX_ADD_STRIP_LIB += \
130 VBoxOGLarrayspu.so \
131 VBoxOGLcrutil.so \
132 VBoxOGLerrorspu.so \
133 VBoxOGLfeedbackspu.so \
134 VBoxOGLpackspu.so \
135 VBoxOGLpassthroughspu.so \
136 VBoxOGL.so
137endif
138
139VBOX_ADD_STRIP_MOD.linux = \
140 vboxmouse_drv_70.so \
141 vboxmouse_drv_71.so \
142 vboxmouse_drv_13.so \
143 vboxmouse_drv_14.so \
144 vboxmouse_drv_15.so \
145 vboxmouse_drv_16.so \
146 $(addsuffix .so,$(filter-out %_32,$(filter vboxvideo_drv_%,$(DLLS)))) \
147 $(if $(VBOX_WITH_PAM),pam_vbox.so,) \
148 mount.vboxsf
149
150VBOX_ADD_MOD.linux = \
151 98vboxadd-xclient \
152 x11config.sh
153
154VBOX_ADD_STRIP_OBJ.linux = \
155 vboxmouse_drv.o \
156 vboxvideo_drv.o
157
158VBOX_ADD_KMOD_FILES = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, Makefile build_in_tmp)
159VBOX_ADD_KMOD_DIRS = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, vboxguest/ vboxsf/ 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_FILES= $(VBOX_ADD_KMOD_FILES)
174VBOX_LNX_ADD_KMOD_DIRS = $(VBOX_ADD_KMOD_DIRS)
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_FILES)) \
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
192## @todo figure how to clean these... Or maybe rewrite everything here to somehow use install targets?
193VBOX_LNX_ADD_INST_DIRS := \
194 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS))
195
196VBOX_LNX_ADD_DBG_FILES := \
197 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
198 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
199 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
200 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
201
202ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
203VBOX_LNX_ADD_INST_FILES += \
204 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter)
205endif
206
207# Cleanup of the the installer directory files
208OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DBG_FILES)
209
210# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
211$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
212 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
213 $(call MSG_TOOL,copydbg,$<,$@)
214 $(QUIET)objcopy --only-keep-debug $< $@
215
216$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
217 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
218 $(call MSG_TOOL,copydbg,$<,$@)
219 $(QUIET)objcopy --only-keep-debug $< $@
220
221$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
222 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
223 $(call MSG_TOOL,copydbg,$<,$@)
224 $(QUIET)objcopy --only-keep-debug $< $@
225
226$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
227 $(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
228 $(call MSG_TOOL,copydbg,$<,$@)
229 $(QUIET)objcopy --only-keep-debug $< $@
230
231# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
232$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
233 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
234 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
235 | $$(dir $$@)
236 $(call MSG_INST_FILE,$<,$@)
237 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
238 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_DBG_BIN_DIR),$@) $@
239
240# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
241$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),\
242 $(filter-out vbox-greeter,$(VBOX_LNX_ADD_STRIP_SBIN))): \
243 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
244 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
245 | $$(dir $$@)
246 $(call MSG_INST_FILE,$<,$@)
247 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
248 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_DBG_SBIN_DIR),$@) $@
249
250# pattern rule for stripping and copying vbox-greeter to the installation directory
251$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),vbox-greeter): \
252 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(subst linux.amd64/release,linux.amd64/release/greeter,$(subst linux.x86/release,linux.x86/release/greeter,$(PATH_STAGE_BIN)))/additions/% \
253 | $$(dir $$@)
254 $(call MSG_INST_FILE,$<,$@)
255 $(QUIET)$(INSTALL) -m 0755 $< $@
256
257# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
258$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
259 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% \
260 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
261 | $$(dir $$@)
262 $(call MSG_INST_FILE,$<,$@)
263 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
264 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_DBG_LIB_DIR),$@) $@
265
266# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
267$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
268 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% \
269 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
270 | $$(dir $$@)
271 $(call MSG_INST_FILE,$<,$@)
272 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
273 $(QUIET)objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_DBG_MOD_DIR),$@) $@
274
275# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
276$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
277 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
278 $(call MSG_INST_FILE,$<,$@)
279ifeq ($(VBOX_DO_STRIP),)
280 $(QUIET)$(INSTALL) -m 0644 $< $@
281else # strip to temp file because of umask.
282 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
283 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
284 $(QUIET)$(RM) -f -- [email protected]
285endif
286
287# pattern rules for copying the VBOX_LNX_ADD_KMOD files to the installation directory
288$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS)): \
289 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
290 $(PATH_STAGE_BIN)/additions/src/% \
291 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*) \
292 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*) \
293 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*) \
294 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*/*) \
295 $(wildcard $(PATH_STAGE_BIN)/additions/src/%*/*/*/*/*) \
296 $(VBOX_VERSION_STAMP) $(VBOX_SVN_REV_HEADER) \
297 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
298 $(call MSG_INST_DIR,$<,$@)
299 $(QUIET)$(RM) -Rf $(filter-out $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD),$(wildcard $(VBOX_LNX_ADD_INST_KMOD_DIR)*/))
300 $(QUIET)$(CP) -RPf -- $< $@
301
302$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)): \
303 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
304 $(PATH_STAGE_BIN)/additions/src/% \
305 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
306 $(call MSG_INST_FILE,$<,$@)
307 $(QUIET)$(CP) -RPf -- $< $@
308
309# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
310$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
311 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
312 $(call MSG_INST_FILE,$<,$@)
313# Remove target directories first, otherwise the behaviour of cp will not be
314# what we want if it already exists. See the cp manual page for more details.
315 $(QUIET)$(RM) -Rf $@
316 $(QUIET)$(CP) -RPf -- $< $@
317
318# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
319$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
320 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
321 $(call MSG_INST_FILE,$<,$@)
322# Remove target directories first, otherwise the behaviour of cp will not be
323# what we want if it already exists. See the cp manual page for more details.
324 $(QUIET)$(RM) -Rf $@
325 $(QUIET)$(CP) -RPf -- $< $@
326
327INSTALLS += GuestDrivers-src
328GuestDrivers-src_INST = $(INST_ADDITIONS)src/
329GuestDrivers-src_MODE = a+r,u+w
330GuestDrivers-src_SOURCES = Makefile
331
332
333INSTALLS += lnx_add_inst-exec
334lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_MOD_DIR)
335lnx_add_inst-exec_INSTTYPE = stage
336lnx_add_inst-exec_EXEC_SOURCES = \
337 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
338 $(VBOX_REL_X11_ADD_INST)x11config.sh
339
340
341INSTALLS += lnx_add_inst-noexec
342lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)/
343lnx_add_inst-noexec_INSTTYPE = stage
344lnx_add_inst-noexec_SOURCES = \
345 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
346 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
347 $(if $(VBOX_WITH_LIGHTDM_GREETER_PACKING),lightdm-greeter/vbox-greeter.desktop,) \
348 selinux-fedora/vbox_x11.pp \
349 selinux-fedora/vbox_accel.pp
350
351INSTALLS += lnx_add_inst-license
352lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
353lnx_add_inst-license_INSTTYPE = stage
354lnx_add_inst-license_SOURCES = \
355 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
356
357
358#
359# We need our routines.sh and the uninstallation scripts in the staging
360# directory too
361#
362INSTALLS += LnxAdd-scripts
363LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
364LnxAdd-scripts_INSTTYPE = stage
365LnxAdd-scripts_SOURCES = \
366 $(VBOX_REL_LNX_ADD_INST)deffiles
367LnxAdd-scripts_EXEC_SOURCES = \
368 $(VBOX_REL_LNX_INST_SRC)routines.sh \
369 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
370 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
371 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11
372
373ifdef VBOX_WITH_LIGHTDM_GREETER_PACKING
374 LnxAdd-scripts_EXEC_SOURCES += \
375 $(VBOX_REL_LNX_ADD_INST)module-autologon.sh=>installer/module-autologon
376endif
377
378
379#
380# And the init scripts
381#
382INSTALLS += LnxAdd-init-scripts
383LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
384LnxAdd-init-scripts_EXEC_SOURCES = \
385 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
386
387
388# this file needs editing before it can be included in the generic installer.
389$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
390 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh \
391 $(VBOX_VERSION_STAMP) | $$(dir $$@)
392 $(RM) -f -- $@
393 $(QUIET)$(SED) \
394 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
395 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
396 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
397 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
398 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
399 -e "s;_USERNAME_;$(USERNAME);g" \
400 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
401 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxvfs vboxadd-timesync vboxadd-service vboxadd;g" \
402 --output $@ \
403 $<
404 $(QUIET)$(CHMOD) 0755 $@
405OTHER_CLEAN += \
406 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
407 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
408
409
410include $(FILE_KBUILD_SUB_FOOTER)
411
412
413# All the files that go into our archive
414VBOX_LNX_ADD_ARCH_FILES = \
415 $(lnx_add_inst-noexec_2_STAGE_TARGETS) \
416 $(lnx_add_inst-exec_2_STAGE_TARGETS) \
417 $(lnx_add_inst-license_2_STAGE_TARGETS) \
418 $(VBOX_LNX_ADD_INST_FILES) \
419 $(VBOX_LNX_ADD_INST_DIRS)
420
421#
422# .tar.bz2 for converting into .run
423#
424$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
425 $(VBOX_LNX_ADD_ARCH_FILES) \
426 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
427 $(VBOX_VERSION_STAMP)
428 $(call MSG_L1,Packing $@)
429 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
430 $(QUIET)$(MKDIR) -p $(@D)
431 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_ARCH_INST_DIRS)
432ifdef VBOX_USE_PBZIP2
433 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
434 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
435 LICENSE bin init lib sbin share src \
436 $(if $(filter $(KBUILD_TYPE),debug),debug)
437 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
438else
439 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
440 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
441 LICENSE 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_STAGE_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)
456 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_DBG_DIRS)
457ifdef VBOX_USE_PBZIP2
458 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
459 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
460 bin lib sbin
461 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
462else
463 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
464 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
465 bin lib sbin
466endif
467 $(QUIET)$(CHMOD) 0644 $@
468
469
470#
471# Build the Linux Guest Additions self extracting installer.
472#
473# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
474# any references should be made via variables assigned a know value via := .
475#
476$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
477 $(VBOX_LNX_ADD_ARCHIVES) \
478 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
479 $$(LnxAdd-scripts_2_STAGE_TARGETS) \
480 $(VBOX_VERSION_STAMP)
481 # Remove any archives left over from previous builds so that they don't
482 # end up in our installer as well.
483 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
484 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
485 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
486 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
487 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
488 /bin/sh ./install.sh "\$$0 1> /dev/null"
489
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