VirtualBox

source: vbox/trunk/src/VBox/Installer/linux/Makefile.kmk@ 43429

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

Installer: add VBoxHostChannel service library.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.8 KB
Line 
1# $Id: Makefile.kmk 43429 2012-09-25 13:57:48Z vboxsync $
2## @file
3# Makefile for the Linux installer.
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# Include sub-makefile.
22ifdef VBOX_WITH_TESTCASES
23 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
24endif
25
26ifneq ($(KBUILD_HOST),linux)
27 $(error "The Linux installer can only be built on Linux!")
28endif
29
30#
31# Globals and targets.
32#
33VBOX_PATH_LNX_INST_SRC := $(PATH_SUB_CURRENT)
34VBOX_LNX_INST_OUT_DIR := $(PATH_TARGET)/Installer/linux
35VBOX_LNX_INST_STAGE_DIR := $(PATH_TARGET)/Installer/linux/install
36VBOX_LNX_INST_STAGE_DIR_REL := obj/Installer/linux/install
37VBOX_LNX_DBG_PATH := usr/lib/debug/opt/VirtualBox
38VBOX_LNX_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
39
40# Unset this to speed up things during makefile hacking.
41VBOX_LNX_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
42
43BLDDIRS += $(VBOX_LNX_INST_OUT_DIR) $(VBOX_LNX_INST_STAGE_DIR)
44PACKING += $(PATH_STAGE_BIN)/VirtualBox.tar.bz2
45if !defined(VBOX_NO_LINUX_RUN_INSTALLER)
46 PACKING += $(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME) \
47 $(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2
48endif
49
50OTHER_CLEAN += \
51 $(addprefix $(VBOX_LNX_INST_STAGE_DIR)/,\
52 install.sh \
53 vboxdrv.sh \
54 VirtualBox.tar.bz2 \
55 LICENSE) \
56 $(wildcard $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-*) \
57 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/,\
58 vboxdrv.sh \
59 install.sh)
60
61#
62# Linux installs.
63#
64INSTALLS += linux-bin
65linux-bin_INST = bin/
66linux-bin_MODE = a+rx,u+w
67linux-bin_SOURCES = \
68 VBoxSysInfo.sh \
69 VBoxCreateUSBNode.sh \
70 VBox.sh=>VBox.sh \
71 $(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py=>vboxshell.py,)
72
73INSTALLS += linux-scripts
74linux-scripts_INST = $(VBOX_LNX_INST_STAGE_DIR_REL)/
75linux-scripts_MODE = a+rx,u+w
76linux-scripts_SOURCES = \
77 deffiles \
78 routines.sh \
79 uninstall.sh \
80 vboxautostart-service.sh \
81 vboxballoonctrl-service.sh \
82 vboxdrv-pardus.py \
83 vboxweb-service.sh
84
85INSTALLS += linux-misc
86linux-misc_INST = bin/
87linux-misc_MODE = a+r,u+w
88linux-misc_SOURCES = \
89 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
90 $(PATH_ROOT)/src/VBox/Installer/common/virtualbox.xml \
91 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
92 $(if $(VBOX_WITH_QTGUI),$(linux-misc_0_OUTDIR)/virtualbox.desktop,)
93linux-misc_CLEAN = $(linux-misc_0_OUTDIR)/virtualbox.desktop
94
95$$(linux-misc_0_OUTDIR)/virtualbox.desktop: $(PATH_ROOT)/src/VBox/Installer/common/virtualbox.desktop.in $(VBOX_VERSION_STAMP) | $$(dir $$@)
96 $(call MSG_GENERATE,,$@,$<)
97ifdef VBOX_PATH_PACKAGE_DOCS
98 $(QUIET)$(SED) -e "s+@VBOX_DOC_PATH@+$(VBOX_PATH_PACKAGE_DOCS)+" \
99 -e "s+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+" \
100 --output $@ $<
101else
102 $(QUIET)$(SED) -e "s+@VBOX_DOC_PATH@+/opt/VirtualBox+" \
103 -e "s+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+" \
104 --output $@ $<
105endif
106
107INSTALLS += linux-icons
108linux-icons_INST = bin/icons/
109linux-icons_MODE = a+r,u+w
110linux-icons_SOURCES = $(VBOX_MIME_ICONS) $(VBOX_DESKTOP_ICONS)
111
112
113#
114# The files residing in bin/ that we'll ship.
115#
116
117# Strip these binaries
118VBOX_LNX_STRIP_BIN = \
119 VBoxDD.so \
120 VBoxDD2.so \
121 VBoxREM.so \
122 VBoxDDU.so \
123 VBoxVMM.so \
124 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
125 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
126 VBoxRT.so \
127 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
128 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
129 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
130 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
131 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
132 VBoxHostChannel.so \
133 $(if $(VBOX_WITH_DRAG_AND_DROP),VBoxDragAndDropSvc.so,) \
134 $(if $(VBOX_WITH_MAIN), \
135 VBoxAutostart \
136 VBoxBalloonCtrl \
137 VBoxManage \
138 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
139 VBoxNetAdpCtl \
140 VBoxSVC \
141 VBoxXPCOM.so \
142 VBoxXPCOMC.so \
143 VBoxXPCOMIPCD \
144 components/VBoxXPCOMIPCC.so \
145 components/VBoxSVCM.so \
146 components/VBoxC.so,) \
147 $(if $(VBOX_WITH_CROGL),\
148 VBoxOGLhostcrutil.so \
149 VBoxOGLhosterrorspu.so \
150 VBoxOGLrenderspu.so \
151 $(if $(VBOX_WITH_QTGUI),VBoxTestOGL,) \
152 VBoxSharedCrOpenGL.so,) \
153 $(if $(VBOX_WITH_PYTHON),$(notdir $(wildcard $(PATH_STAGE_BIN)/VBoxPython*.so)),) \
154 $(if $(VBOX_WITH_JXPCOM),libvboxjxpcom.so,) \
155 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
156 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNC.so \
157 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNCMain.so,) \
158 VBoxTunctl
159
160# Do not remove relocation information of these binaries
161VBOX_LNX_STRIP_OBJ = \
162 VBoxDD2R0.r0 \
163 VBoxDDR0.r0 \
164 VMMR0.r0
165
166ifdef VBOX_WITH_RAW_MODE
167 VBOX_LNX_STRIP_OBJ += \
168 VBoxDD2GC.gc \
169 VBoxDDGC.gc \
170 VMMGC.gc
171endif
172
173# Do not strip anything of these files
174VBOX_LNX_NO_STRIP = \
175 $(if $(VBOX_OSE),,LICENSE) \
176 $(if $(VBOX_WITH_MAIN), \
177 components/VBoxXPCOMBase.xpt \
178 components/VirtualBox_XPCOM.xpt) \
179 $(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
180 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
181 ExtensionPacks/VNC/ExtPack.xml \
182 ExtensionPacks/VNC/ExtPack-license.html \
183 ExtensionPacks/VNC/ExtPack-license.rtf \
184 ExtensionPacks/VNC/ExtPack-license.txt,) \
185 VBoxSysInfo.sh \
186 VBoxCreateUSBNode.sh \
187 VBox.sh \
188 VBox.png
189
190ifdef VBOX_WITH_EXTPACK
191 VBOX_LNX_STRIP_BIN += \
192 VBoxExtPackHelperApp
193endif
194
195# Qt4 GUI
196ifdef VBOX_WITH_QTGUI
197 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
198 VBOX_LNX_STRIP_BIN += \
199 VBoxKeyboard.so \
200 VirtualBox \
201 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
202 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
203 VBOX_LNX_NO_STRIP += \
204 virtualbox.desktop \
205 virtualbox.xml \
206 $(VBOX_LICENSE_FILES) \
207 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
208 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
209 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm) \
210 icons
211endif
212
213# Guest Additions
214ifdef VBOX_WITH_ADDITIONS_PACKING
215 VBOX_LNX_NO_STRIP += \
216 additions/VBoxGuestAdditions.iso
217endif
218
219# Documentation
220ifdef VBOX_WITH_DOCS_PACKING
221 VBOX_LNX_NO_STRIP += \
222 UserManual.pdf \
223 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).pdf)
224 ifdef VBOX_WITH_DOCS_CHM
225 VBOX_LNX_NO_STRIP += \
226 VirtualBox.chm \
227 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm)
228 endif
229 VBOX_LNX_STRIP_BIN += \
230 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
231endif
232
233# auth stuff
234VBOX_LNX_STRIP_BIN += \
235 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
236 VBoxAuthSimple.so
237
238# VRDP
239ifdef VBOX_WITH_VRDP
240 ifndef VBOX_WITH_EXTPACK_PUEL
241 VBOX_LNX_STRIP_BIN += \
242 VBoxVRDP.so
243 endif
244 ifdef VBOX_WITH_VRDP_RDESKTOP
245 VBOX_LNX_NO_STRIP += \
246 rdesktop-vrdp.tar.gz
247 VBOX_LNX_NO_STRIP += \
248 rdesktop-vrdp-keymaps
249 VBOX_LNX_STRIP_BIN += \
250 rdesktop-vrdp
251 endif
252endif
253
254# Python XPCOM glue
255ifdef VBOX_WITH_PYTHON
256 VBOX_LNX_NO_STRIP += \
257 $(foreach f,$(notdir $(wildcard $(PATH_STAGE_BIN)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
258 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
259 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
260 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
261 sdk/bindings/xpcom/python/xpcom/server/factory.py \
262 sdk/bindings/xpcom/python/xpcom/server/loader.py \
263 sdk/bindings/xpcom/python/xpcom/server/module.py \
264 sdk/bindings/xpcom/python/xpcom/server/policy.py \
265 sdk/installer/vboxapisetup.py \
266 sdk/installer/vboxapi/__init__.py \
267 sdk/installer/vboxapi/VirtualBox_constants.py
268endif
269
270# Java XPCOM bridge
271ifdef VBOX_WITH_JXPCOM
272 VBOX_LNX_NO_STRIP += \
273 sdk/bindings/xpcom/java/vboxjxpcom.jar
274endif
275
276# Headless
277ifdef VBOX_WITH_HEADLESS
278 VBOX_LNX_STRIP_BIN += \
279 VBoxHeadless \
280 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
281endif
282
283# BFE
284ifdef VBOX_WITH_BFE
285 VBOX_LNX_STRIP_BIN += \
286 VBoxBFE \
287 $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
288endif
289
290# Webservices
291ifdef VBOX_WITH_WEBSERVICES
292 VBOX_LNX_STRIP_BIN += \
293 vboxwebsrv \
294 webtest
295endif
296
297# EFI firmware
298ifdef VBOX_WITH_EFIFW_PACKING
299 VBOX_LNX_NO_STRIP += \
300 VBoxEFI32.fd \
301 VBoxEFI64.fd
302endif
303
304VBOX_MIME_ICONS = \
305 $(addprefix $(PATH_ROOT)/src/VBox/Resources/other/,\
306 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
307 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
308 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
309
310VBOX_DESKTOP_ICONS = \
311 $(addprefix $(PATH_ROOT)/src/VBox/Resources/$(if $(VBOX_OSE),OSE,NonOSE)/,\
312 $(foreach s,16 20 32 40 48 64 128,\
313 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png))
314
315#
316# All the bin files that goes into the archives.
317#
318VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
319
320# Cleanup of the files we copy/symlink from bin.
321OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
322 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
323
324#
325# The generic installer.
326#
327$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
328 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
329 $(VBOX_VERSION_STAMP) \
330 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
331 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
332 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
333 $(VBOX_PATH_LNX_INST_SRC)/installer-common.sh \
334 $$(linux-scripts_2_STAGE_TARGETS)
335 $(call MSG_TOOL,makeself,,$@)
336 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
337 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
338 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
339 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
340 $(QUIET)$(RM) -f $@
341 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
342 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
343
344# files that needs editing before they can be included in the generic installer.
345$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
346 $(QUIET)$(SED_EXT) \
347 -e "s|%NOLSB%|yes|g" \
348 -e "s|%DEBIAN%||g" \
349 -e "s|%PACKAGE%|virtualbox|g" \
350 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
351 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
352 --output $@ \
353 $<
354
355$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_PATH_LNX_INST_SRC)/installer-common.sh $(VBOX_VERSION_STAMP) $(VBOX_SVN_REV_KMK).ts | $$(dir $$@)
356 $(QUIET)$(SED) \
357 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
358 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
359 -e "s;_BUILD_;$(date-utc );g" \
360 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
361 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
362 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
363 -e "s;_USERNAME_;$(USERNAME);g" \
364 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
365 -e '/#include installer-common.sh/ {' \
366 -e "r $(PATH_ROOT)/src/VBox/Installer/linux/installer-common.sh" \
367 -e 'd' \
368 -e '}' \
369 --output $@ \
370 $<
371
372#
373# The files that the tar archives depend on. The wildcards are ugly, but they
374# do save us from having to update the makefile whenever something new is added
375# to the module source directories.
376#
377VBOX_LNX_INST_ARCH_DEPS := \
378 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
379 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
380 $(VBOX_VERSION_STAMP) \
381 $(wildcard $(PATH_STAGE_BIN)/src/*) \
382 $(wildcard $(PATH_STAGE_BIN)/src/*/*) \
383 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*) \
384 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*/*)
385
386
387#
388# .tar.bz2 for converting into .run
389#
390$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
391 $(call MSG_L1,Packing $@)
392 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
393 $(QUIET)$(MKDIR) -p $(@D)
394ifdef VBOX_USE_PBZIP2
395 $(QUIET)tar --dereference --owner 0 --group 0 \
396 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
397 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
398else
399 $(QUIET)tar --dereference --owner 0 --group 0 \
400 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
401endif
402 $(QUIET)$(CHMOD) 0644 $@
403
404#
405# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
406#
407$(PATH_STAGE_BIN)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
408 $(call MSG_L1,Packing $@)
409 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
410 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
411ifdef VBOX_USE_PBZIP2
412 $(QUIET)tar --dereference --owner 0 --group 0 \
413 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
414 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
415 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
416else
417 $(QUIET)tar --dereference --owner 0 --group 0 \
418 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
419 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
420endif
421 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
422
423
424# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
425$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
426 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
427 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
428 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
429 | $$(dir $$@)
430 $(call MSG_INST_FILE,$<,$@)
431 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
432 $(QUIET)$(if $(VBOX_NO_LINUX_RUN_INSTALLER),,objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_INST_OUT_DIR)/archive,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH),$@) $@)
433
434# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
435$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
436 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
437 $(call MSG_INST_FILE,$<,$@)
438ifeq ($(VBOX_DO_STRIP),)
439 $(QUIET)$(INSTALL) -m 0644 $< $@
440else # strip to temp file because of umask.
441 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
442 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
443 $(QUIET)$(RM) -f -- $@.tmp
444endif
445
446# special rule for the kernel modules
447$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
448 $(call MSG_INST_SYM,$<,$@)
449 $(QUIET)$(RM) -Rf $@
450 $(QUIET)$(MKDIR) $@
451 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
452
453# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
454$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
455 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
456 $(call MSG_INST_SYM,$<,$@)
457 $(QUIET)$(RM) -f $@
458 $(QUIET)$(LN_SYMLINK) $< $@
459
460# rules for creating directories in archive (the pattern rules depends on these).
461BLDDIRS += $(foreach d,\
462 archive \
463 archive/components \
464 archive/nls \
465 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
466 $(if $(VBOX_WITH_PYTHON),\
467 archive/sdk/installer \
468 archive/sdk/installer/vboxapi \
469 archive/sdk/bindings/xpcom/python/xpcom \
470 archive/sdk/bindings/xpcom/python/xpcom/client \
471 archive/sdk/bindings/xpcom/python/xpcom/server,) \
472 $(if $(VBOX_WITH_JXPCOM),\
473 archive/sdk/bindings/xpcom/java,) \
474 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
475 archive/ExtensionPacks/VNC \
476 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
477 archive/additions \
478 install\
479,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
480
481
482#
483# .tar.bz2 for with the debug info.
484#
485$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
486 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
487 $(call MSG_L1,Packing $@)
488 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
489ifdef VBOX_USE_PBZIP2
490 $(QUIET)tar --dereference --owner 0 --group 0 \
491 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
492 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
493 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
494else
495 $(QUIET)tar --dereference --owner 0 --group 0 \
496 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
497 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
498endif
499
500# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
501$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
502 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
503 $(call MSG_TOOL,copydbg,$<,$@)
504 $(QUIET)objcopy --only-keep-debug $< $@
505
506# rules for creating directories in archive-dbg (the pattern rules depends on these).
507BLDDIRS += $(foreach d,\
508 $(VBOX_LNX_DBG_PATH) \
509 $(VBOX_LNX_DBG_PATH)/components \
510,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
511
512include $(FILE_KBUILD_SUB_FOOTER)
513
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