VirtualBox

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

Last change on this file since 66891 was 66191, checked in by vboxsync, 8 years ago

bugref:4567: Linux kernel driver maintenance: do not try to do test builds of Linux kernel modules if the target architecture is not the same as the host one, e.g. 32-bit on 64-bit.

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