VirtualBox

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

Last change on this file since 41943 was 41477, checked in by vboxsync, 13 years ago

/Makefile.kmk: Cosmetic changes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.7 KB
Line 
1# $Id: Makefile.kmk 41477 2012-05-29 11:43:27Z 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 $(if $(VBOX_WITH_PAM),pam_vbox.so,) \
156 mount.vboxsf
157
158VBOX_ADD_MOD.linux = \
159 98vboxadd-xclient \
160 x11config.sh
161
162VBOX_ADD_STRIP_OBJ.linux = \
163 vboxmouse_drv.o \
164 vboxvideo_drv.o
165
166VBOX_ADD_KMOD_FILES = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, Makefile dkms.conf do_dkms build_in_tmp)
167VBOX_ADD_KMOD_DIRS = $(addprefix vboxguest-$(VBOX_VERSION_STRING)/, vboxguest/ vboxsf/ vboxvideo/)
168
169VBOX_ADD_INIT.linux = \
170 vboxadd \
171 vboxadd-service \
172 vboxadd-x11
173
174VBOX_LNX_ADD_STRIP_BIN = $(VBOX_ADD_STRIP_BIN) $(VBOX_ADD_STRIP_BIN.linux)
175VBOX_LNX_ADD_BIN = $(VBOX_ADD_BIN) $(VBOX_ADD_BIN.linux)
176VBOX_LNX_ADD_STRIP_SBIN= $(VBOX_ADD_STRIP_SBIN) $(VBOX_ADD_STRIP_SBIN.linux)
177VBOX_LNX_ADD_STRIP_LIB = $(VBOX_ADD_STRIP_LIB) $(VBOX_ADD_STRIP_LIB.linux)
178VBOX_LNX_ADD_STRIP_MOD = $(VBOX_ADD_STRIP_MOD) $(VBOX_ADD_STRIP_MOD.linux)
179VBOX_LNX_ADD_MOD = $(VBOX_ADD_MOD) $(VBOX_ADD_MOD.linux)
180VBOX_LNX_ADD_STRIP_OBJ = $(VBOX_ADD_STRIP_OBJ) $(VBOX_ADD_STRIP_OBJ.linux)
181VBOX_LNX_ADD_KMOD_FILES= $(VBOX_ADD_KMOD_FILES)
182VBOX_LNX_ADD_KMOD_DIRS = $(VBOX_ADD_KMOD_DIRS)
183VBOX_LNX_ADD_INIT = $(VBOX_ADD_INIT) $(VBOX_ADD_INIT.linux)
184
185#
186# All the files that go into the archive
187#
188VBOX_LNX_ADD_INST_FILES := \
189 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
190 $(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_BIN)) \
191 $(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
192 $(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
193 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)) \
194 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_MOD)) \
195 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)) \
196 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_FILES)) \
197 $(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)) \
198 $(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT))
199
200## @todo figure how to clean these... Or maybe rewrite everything here to somehow use install targets?
201VBOX_LNX_ADD_INST_DIRS := \
202 $(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS))
203
204VBOX_LNX_ADD_DBG_FILES := \
205 $(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)) \
206 $(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)) \
207 $(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)) \
208 $(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD))
209
210# Cleanup of the the installer directory files
211OTHER_CLEAN += $(VBOX_LNX_ADD_INST_FILES) $(VBOX_LNX_ADD_DBG_FILES)
212
213# pattern rules for copying the debug info from the VBOX_LNX_ADD_STRIP_* files to the installation directory
214$(addprefix $(VBOX_LNX_ADD_DBG_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
215 $(VBOX_LNX_ADD_DBG_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
216 $(call MSG_TOOL,copydbg,$<,$@)
217 $(QUIET)objcopy --only-keep-debug $< $@
218
219$(addprefix $(VBOX_LNX_ADD_DBG_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
220 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
221 $(call MSG_TOOL,copydbg,$<,$@)
222 $(QUIET)objcopy --only-keep-debug $< $@
223
224$(addprefix $(VBOX_LNX_ADD_DBG_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
225 $(VBOX_LNX_ADD_DBG_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
226 $(call MSG_TOOL,copydbg,$<,$@)
227 $(QUIET)objcopy --only-keep-debug $< $@
228
229$(addprefix $(VBOX_LNX_ADD_DBG_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
230 $(VBOX_LNX_ADD_DBG_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
231 $(call MSG_TOOL,copydbg,$<,$@)
232 $(QUIET)objcopy --only-keep-debug $< $@
233
234# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_BIN files to the installation directory
235$(addprefix $(VBOX_LNX_ADD_INST_BIN_DIR),$(VBOX_LNX_ADD_STRIP_BIN)): \
236 $(VBOX_LNX_ADD_INST_BIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
237 $(VBOX_LNX_ADD_DBG_BIN_DIR)% \
238 | $$(dir $$@)
239 $(call MSG_INST_FILE,$<,$@)
240 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
241 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
242
243# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_SBIN files to the installation directory
244$(addprefix $(VBOX_LNX_ADD_INST_SBIN_DIR),$(VBOX_LNX_ADD_STRIP_SBIN)): \
245 $(VBOX_LNX_ADD_INST_SBIN_DIR)% : $(PATH_STAGE_BIN)/additions/% \
246 $(VBOX_LNX_ADD_DBG_SBIN_DIR)% \
247 | $$(dir $$@)
248 $(call MSG_INST_FILE,$<,$@)
249 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
250 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
251
252# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_LIB files to the installation directory
253$(addprefix $(VBOX_LNX_ADD_INST_LIB_DIR),$(VBOX_LNX_ADD_STRIP_LIB)): \
254 $(VBOX_LNX_ADD_INST_LIB_DIR)% : $(PATH_STAGE_BIN)/additions/% \
255 $(VBOX_LNX_ADD_DBG_LIB_DIR)% \
256 | $$(dir $$@)
257 $(call MSG_INST_FILE,$<,$@)
258 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
259 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
260
261# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_MOD files to the installation directory
262$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_MOD)): \
263 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% \
264 $(VBOX_LNX_ADD_DBG_MOD_DIR)% \
265 | $$(dir $$@)
266 $(call MSG_INST_FILE,$<,$@)
267 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
268 $(QUIET)objcopy --add-gnu-debuglink=$@ $@
269
270# pattern rule for stripping and copying the VBOX_LNX_ADD_STRIP_OBJ files to the installation directory
271$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_STRIP_OBJ)): \
272 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
273 $(call MSG_INST_FILE,$<,$@)
274ifeq ($(VBOX_DO_STRIP),)
275 $(QUIET)$(INSTALL) -m 0644 $< $@
276else # strip to temp file because of umask.
277 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
278 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
279 $(QUIET)$(RM) -f -- $@.tmp
280endif
281
282# pattern rule for copying the VBOX_LNX_ADD_KMOD files to the installation directory
283$(addprefix $(VBOX_LNX_ADD_INST_KMOD_DIR),$(VBOX_LNX_ADD_KMOD_DIRS) $(VBOX_LNX_ADD_KMOD_FILES)): \
284 $(VBOX_LNX_ADD_INST_KMOD_DIR_MOD)% : \
285 $(PATH_STAGE_BIN)/additions/src/% \
286 | $$(dir $$(patsubst $$(PERCENT)/,$$(PERCENT),$$@))
287 $(call MSG_INST_DIR,$<,$@)
288 $(QUIET)$(RM) -Rf $@
289 $(QUIET)$(CP) -RPf -- $< $@
290
291# pattern rule for copying the VBOX_LNX_ADD_INIT files to the installation directory
292$(addprefix $(VBOX_LNX_ADD_INST_INIT_DIR),$(VBOX_LNX_ADD_INIT)): \
293 $(VBOX_LNX_ADD_INST_INIT_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
294 $(call MSG_INST_FILE,$<,$@)
295# Remove target directories first, otherwise the behaviour of cp will not be
296# what we want if it already exists. See the cp manual page for more details.
297 $(QUIET)$(RM) -Rf $@
298 $(QUIET)$(CP) -RPf -- $< $@
299
300# pattern rule for copying the VBOX_LNX_ADD_INIT files to the module directory
301$(addprefix $(VBOX_LNX_ADD_INST_MOD_DIR),$(VBOX_LNX_ADD_INIT)): \
302 $(VBOX_LNX_ADD_INST_MOD_DIR)% : $(PATH_STAGE_BIN)/additions/% | $$(dir $$@)
303 $(call MSG_INST_FILE,$<,$@)
304# Remove target directories first, otherwise the behaviour of cp will not be
305# what we want if it already exists. See the cp manual page for more details.
306 $(QUIET)$(RM) -Rf $@
307 $(QUIET)$(CP) -RPf -- $< $@
308
309
310INSTALLS += GuestDrivers-src
311GuestDrivers-src_INST = $(INST_ADDITIONS)src/
312GuestDrivers-src_MODE = a+r,u+w
313GuestDrivers-src_SOURCES = Makefile
314
315
316INSTALLS += lnx_add_inst-exec
317lnx_add_inst-exec_INST = $(VBOX_LNX_ADD_INST_MOD_DIR)
318lnx_add_inst-exec_INSTTYPE = stage
319lnx_add_inst-exec_EXEC_SOURCES = \
320 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient \
321 $(VBOX_REL_X11_ADD_INST)x11config.sh
322
323
324INSTALLS += lnx_add_inst-noexec
325lnx_add_inst-noexec_INST = $(VBOX_LNX_ADD_INST_SHARE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)/
326lnx_add_inst-noexec_INSTTYPE = stage
327lnx_add_inst-noexec_SOURCES = \
328 $(VBOX_REL_X11_ADD_INST)vboxclient.desktop \
329 $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
330 selinux-fedora/vbox_x11.pp \
331 selinux-fedora/vbox_accel.pp
332
333INSTALLS += lnx_add_inst-license
334lnx_add_inst-license_INST = $(VBOX_LNX_ADD_INST_OUT_DIR)
335lnx_add_inst-license_INSTTYPE = stage
336lnx_add_inst-license_SOURCES = \
337 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
338
339
340#
341# We need our routines.sh and the uninstallation scripts in the staging
342# directory too
343#
344INSTALLS += LnxAdd-scripts
345LnxAdd-scripts_INST = $(VBOX_LNX_ADD_INST_STAGE_DIR)
346LnxAdd-scripts_INSTTYPE = stage
347LnxAdd-scripts_SOURCES = \
348 $(VBOX_REL_LNX_ADD_INST)deffiles
349LnxAdd-scripts_EXEC_SOURCES = \
350 $(VBOX_REL_LNX_HOST_DRV)do_dkms \
351 $(VBOX_REL_LNX_INST_SRC)routines.sh \
352 $(VBOX_REL_LNX_ADD_INST)vboxadd.sh=>vboxadd \
353 $(VBOX_REL_LNX_ADD_INST)vboxadd-service.sh=>vboxadd-service \
354 $(VBOX_REL_LNX_ADD_INST)vboxadd-x11.sh=>vboxadd-x11 \
355
356
357#
358# VBoxClient-all
359#
360INSTALLS += LnxAdd-Nostrip-Bin
361LnxAdd-Nostrip-Bin_INST = $(VBOX_LNX_ADD_INST_BIN_DIR)
362LnxAdd-Nostrip-Bin_INSTTYPE = stage
363LnxAdd-Nostrip-Bin_EXEC_SOURCES = \
364 $(VBOX_REL_X11_ADD_INST)98vboxadd-xclient=>VBoxClient-all
365
366
367#
368# And the init scripts
369#
370INSTALLS += LnxAdd-init-scripts
371LnxAdd-init-scripts_INST = $(INST_ADDITIONS)
372LnxAdd-init-scripts_EXEC_SOURCES = \
373 $(foreach i,$(VBOX_LNX_ADD_INIT), installer/$(i).sh=>$(i))
374
375
376# this file needs editing before it can be included in the generic installer.
377$(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh: \
378 $(VBOX_PATH_LNX_INST_SRC)run-inst.sh | $$(dir $$@)
379 $(RM) -f -- $@
380 $(QUIET)$(SED) \
381 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
382 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
383 -e "s;_PACKAGE_NAME_;VirtualBox Guest Additions;g" \
384 -e "s;_PACKAGE_;VBoxGuestAdditions;g" \
385 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
386 -e "s;_USERNAME_;$(USERNAME);g" \
387 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
388 -e "s;_UNINSTALL_SCRIPTS_;vboxadd-x11 vboxvfs vboxadd-timesync vboxadd-service vboxadd;g" \
389 --output $@ \
390 $<
391 $(QUIET)$(CHMOD) 0755 $@
392OTHER_CLEAN += \
393 $(VBOX_LNX_ADD_INST_OUT_DIR)install.sh \
394 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh
395
396
397include $(FILE_KBUILD_SUB_FOOTER)
398
399
400# All the files that go into our archive
401VBOX_LNX_ADD_ARCH_FILES = \
402 $(lnx_add_inst-noexec_2_STAGE_TARGETS) \
403 $(lnx_add_inst-exec_2_STAGE_TARGETS) \
404 $(lnx_add_inst-license_2_STAGE_TARGETS) \
405 $(VBOX_LNX_ADD_INST_FILES) \
406 $(VBOX_LNX_ADD_INST_DIRS)
407
408#
409# .tar.bz2 for converting into .run
410#
411$(VBOX_LNX_ADD_ARCHIVE.$(KBUILD_TARGET_ARCH)): \
412 $(VBOX_LNX_ADD_ARCH_FILES) \
413 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE) \
414 $(VBOX_VERSION_STAMP)
415 $(call MSG_L1,Packing $@)
416 $(QUIET)$(RM) -f -- $(wildcard $(dir $@)VBoxGuestAdditions-*r*.tar.bz2)
417 $(QUIET)$(MKDIR) -p $(@D)
418 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_ARCH_INST_DIRS)
419ifdef VBOX_USE_PBZIP2
420 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
421 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
422 LICENSE bin init lib sbin share src \
423 $(if $(filter $(KBUILD_TYPE),debug),debug)
424 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
425else
426 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
427 -C $(VBOX_LNX_ADD_INST_OUT_DIR) \
428 LICENSE bin init lib sbin share src \
429 $(if $(filter $(KBUILD_TYPE),debug),debug)
430endif
431 $(QUIET)$(CHMOD) 0644 $@
432
433
434#
435# .tar.bz2 containing the debug information
436#
437$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions-dbg.tar.bz2: \
438 $(VBOX_LNX_ADD_DBG_FILES) \
439 $(VBOX_LNX_ADD_INST_DEP_ON_MAKEFILE)
440 $(call MSG_L1,Packing $@)
441 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
442 $(QUIET)$(MKDIR) -p $(@D)
443 $(QUIET)$(CHMOD) 0755 $(VBOX_LNX_ADD_DBG_DIRS)
444ifdef VBOX_USE_PBZIP2
445 $(QUIET)tar --dereference --owner 0 --group 0 -cRf $(patsubst %.bz2,%,$@) \
446 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
447 bin lib sbin
448 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
449else
450 $(QUIET)tar --dereference --owner 0 --group 0 --ignore-failed-read -cjRf $@ \
451 -C $(VBOX_LNX_ADD_INST_DBG_DIR) \
452 bin lib sbin
453endif
454 $(QUIET)$(CHMOD) 0644 $@
455
456
457#
458# Build the Linux Guest Additions self extracting installer.
459#
460# Note that $(PATH_SUB_CURRENT) was changed by subfooter.kmk above and
461# any references should be made via variables assigned a know value via := .
462#
463$(PATH_STAGE_BIN)/additions/VBoxLinuxAdditions.run: \
464 $(VBOX_LNX_ADD_ARCHIVES) \
465 $(VBOX_LNX_ADD_INST_STAGE_DIR)install.sh \
466 $$(LnxAdd-scripts_2_STAGE_TARGETS) \
467 $(VBOX_VERSION_STAMP)
468 # Remove any archives left over from previous builds so that they don't
469 # end up in our installer as well.
470 $(QUIET)$(RM) -f $(foreach file, $(wildcard $(VBOX_LNX_ADD_INST_STAGE_DIR)$(VBOX_LNX_ADD_PACKAGE_NAME)-*.tar.bz2), $(file))
471 $(QUIET)$(foreach file, $(VBOX_LNX_ADD_ARCHIVES), \
472 $(CP) -f $(file) $(VBOX_LNX_ADD_INST_STAGE_DIR)$(subst -r$(VBOX_SVN_REV),,$(notdir $(file)))$(NLTAB) )
473 $(QUIET)$(VBOX_MAKESELF) --nocomp $(VBOX_LNX_ADD_INST_STAGE_DIR) $@ \
474 "VirtualBox $(VBOX_VERSION_STRING) Guest Additions for Linux" \
475 /bin/sh ./install.sh "\$$0 1> /dev/null"
476
477
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