VirtualBox

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

Last change on this file since 53418 was 53418, checked in by vboxsync, 10 years ago

Installer/linux: use pbzip2 automatically if available on the build host

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