VirtualBox

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

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

Ship DbgPlugInDiggers.dll/so/dylib.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.8 KB
Line 
1# $Id: Makefile.kmk 55887 2015-05-16 13:09:45Z 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 $(VBOX_PATH_INST_COMMON_SRC)/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: $(VBOX_PATH_INST_COMMON_SRC)/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 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,)\
176 VBoxTunctl \
177 helpers/generate_service_file
178
179# Do not remove relocation information of these binaries
180VBOX_LNX_STRIP_OBJ = \
181 VBoxDD2R0.r0 \
182 VBoxDDR0.r0 \
183 VMMR0.r0
184
185ifdef VBOX_WITH_RAW_MODE
186 VBOX_LNX_STRIP_OBJ += \
187 VBoxDD2GC.gc \
188 VBoxDDGC.gc \
189 VMMGC.gc
190endif
191
192# Do not strip anything of these files
193VBOX_LNX_NO_STRIP = \
194 $(if $(VBOX_OSE),,LICENSE) \
195 $(if $(VBOX_WITH_MAIN), \
196 components/VBoxXPCOMBase.xpt \
197 components/VirtualBox_XPCOM.xpt) \
198 $(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
199 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
200 ExtensionPacks/VNC/ExtPack.xml \
201 ExtensionPacks/VNC/ExtPack-license.html \
202 ExtensionPacks/VNC/ExtPack-license.rtf \
203 ExtensionPacks/VNC/ExtPack-license.txt,) \
204 VBoxSysInfo.sh \
205 VBoxCreateUSBNode.sh \
206 VBox.sh \
207 VBox.png \
208 scripts
209
210ifdef VBOX_WITH_EXTPACK
211 VBOX_LNX_STRIP_BIN += \
212 VBoxExtPackHelperApp
213endif
214
215# Qt4 GUI
216ifdef VBOX_WITH_QTGUI
217 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
218 VBOX_LNX_STRIP_BIN += \
219 VBoxKeyboard.so \
220 VirtualBox \
221 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
222 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so DbgPlugInDiggers.so)
223 VBOX_LNX_NO_STRIP += \
224 virtualbox.desktop \
225 virtualbox.xml \
226 $(VBOX_LICENSE_FILES) \
227 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
228 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
229 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm) \
230 icons
231endif
232
233# Guest Additions
234ifdef VBOX_WITH_ADDITIONS_PACKING
235 VBOX_LNX_NO_STRIP += \
236 additions/VBoxGuestAdditions.iso
237endif
238
239# Documentation
240ifdef VBOX_WITH_DOCS_PACKING
241 VBOX_LNX_NO_STRIP += \
242 UserManual.pdf \
243 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).pdf)
244 ifdef VBOX_WITH_DOCS_CHM
245 VBOX_LNX_NO_STRIP += \
246 VirtualBox.chm \
247 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm)
248 endif
249 VBOX_LNX_STRIP_BIN += \
250 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
251endif
252
253# auth stuff
254VBOX_LNX_STRIP_BIN += \
255 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
256 VBoxAuthSimple.so
257
258# VRDP
259ifdef VBOX_WITH_VRDP
260 ifndef VBOX_WITH_EXTPACK_PUEL
261 VBOX_LNX_STRIP_BIN += \
262 VBoxVRDP.so
263 endif
264 ifdef VBOX_WITH_VRDP_RDESKTOP
265 VBOX_LNX_NO_STRIP += \
266 rdesktop-vrdp.tar.gz
267 VBOX_LNX_NO_STRIP += \
268 rdesktop-vrdp-keymaps
269 VBOX_LNX_STRIP_BIN += \
270 rdesktop-vrdp
271 endif
272endif
273
274# Python XPCOM glue
275ifdef VBOX_WITH_PYTHON
276 VBOX_LNX_NO_STRIP += \
277 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
278 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
279endif
280
281# Java XPCOM bridge
282ifdef VBOX_WITH_JXPCOM
283 VBOX_LNX_NO_STRIP += \
284 sdk/bindings/xpcom/java/vboxjxpcom.jar
285endif
286
287# Headless
288ifdef VBOX_WITH_HEADLESS
289 VBOX_LNX_STRIP_BIN += \
290 VBoxHeadless \
291 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
292endif
293
294# Webservices
295ifdef VBOX_WITH_WEBSERVICES
296 VBOX_LNX_STRIP_BIN += \
297 vboxwebsrv \
298 webtest
299endif
300
301# vbox-img
302if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
303 VBOX_LNX_STRIP_BIN += \
304 vbox-img
305endif
306
307# EFI firmware
308ifdef VBOX_WITH_EFIFW_PACKING
309 VBOX_LNX_NO_STRIP += \
310 VBoxEFI32.fd \
311 VBoxEFI64.fd
312endif
313
314# DTrace library and scripts.
315ifdef VBOX_WITH_DTRACE
316 VBOX_LNX_NO_STRIP += \
317 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
318 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
319 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
320endif
321
322# Icons
323VBOX_MIME_ICONS = \
324 $(addprefix $(PATH_ROOT)/src/VBox/Resources/other/,\
325 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
326 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
327 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
328
329VBOX_DESKTOP_ICONS = \
330 $(addprefix $(PATH_ROOT)/src/VBox/Resources/$(if $(VBOX_OSE),OSE,NonOSE)/,\
331 $(foreach s,16 20 32 40 48 64 128,\
332 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
333 virtualbox.svg=>scalable/virtualbox.svg)
334
335#
336# All the bin files that goes into the archives.
337#
338VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
339
340# Cleanup of the files we copy/symlink from bin.
341OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
342 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
343
344#
345# The generic installer.
346#
347$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
348 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
349 $(VBOX_VERSION_STAMP) \
350 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
351 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
352 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
353 $(VBOX_PATH_LNX_INST_SRC)/installer-common.sh \
354 $$(linux-scripts_2_STAGE_TARGETS)
355 $(call MSG_TOOL,makeself,,$@)
356 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
357 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
358 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
359 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
360 $(QUIET)$(RM) -f $@
361 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
362 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
363
364# files that needs editing before they can be included in the generic installer.
365$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
366 $(QUIET)$(SED_EXT) \
367 -e "s|%NOLSB%|yes|g" \
368 -e "s|%DEBIAN%||g" \
369 -e "s|%PACKAGE%|virtualbox|g" \
370 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
371 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
372 --output $@ \
373 $<
374
375$(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 $$@)
376 $(QUIET)$(SED) \
377 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
378 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
379 -e "s;_BUILD_;$(date-utc );g" \
380 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
381 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
382 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
383 -e "s;_USERNAME_;$(USERNAME);g" \
384 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
385 -e '/#include installer-common.sh/ {' \
386 -e "r $(PATH_ROOT)/src/VBox/Installer/linux/installer-common.sh" \
387 -e 'd' \
388 -e '}' \
389 --output $@ \
390 $<
391
392#
393# The files that the tar archives depend on. The wildcards are ugly, but they
394# do save us from having to update the makefile whenever something new is added
395# to the module source directories.
396#
397VBOX_LNX_INST_ARCH_DEPS := \
398 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
399 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
400 $(VBOX_VERSION_STAMP) \
401 $(wildcard $(PATH_STAGE_BIN)/src/*) \
402 $(wildcard $(PATH_STAGE_BIN)/src/*/*) \
403 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*) \
404 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*/*) \
405 $(wildcard $(PATH_STAGE_BIN)/scripts/*)
406
407
408#
409# .tar.bz2 for converting into .run
410#
411$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
412 $(call MSG_L1,Packing $@)
413 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
414 $(QUIET)$(MKDIR) -p $(@D)
415ifdef VBOX_USE_PBZIP2
416 $(QUIET)tar --dereference --owner 0 --group 0 \
417 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
418 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
419else
420 $(QUIET)tar --dereference --owner 0 --group 0 \
421 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
422endif
423 $(QUIET)$(CHMOD) 0644 $@
424
425#
426# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
427#
428$(PATH_STAGE_BIN)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
429 $(call MSG_L1,Packing $@)
430 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
431 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
432ifdef VBOX_USE_PBZIP2
433 $(QUIET)tar --dereference --owner 0 --group 0 \
434 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
435 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
436 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
437else
438 $(QUIET)tar --dereference --owner 0 --group 0 \
439 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
440 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
441endif
442 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
443
444
445# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
446$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
447 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
448 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
449 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
450 | $$(dir $$@)
451 $(call MSG_INST_FILE,$<,$@)
452 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
453 $(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),$@) $@)
454
455# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
456$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
457 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
458 $(call MSG_INST_FILE,$<,$@)
459ifeq ($(VBOX_DO_STRIP),)
460 $(QUIET)$(INSTALL) -m 0644 $< $@
461else # strip to temp file because of umask.
462 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
463 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
464 $(QUIET)$(RM) -f -- $@.tmp
465endif
466
467# special rule for the kernel modules
468$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
469 $(call MSG_INST_SYM,$<,$@)
470 $(QUIET)$(RM) -Rf $@
471 $(QUIET)$(MKDIR) $@
472 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
473
474# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
475$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
476 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
477 $(call MSG_INST_SYM,$<,$@)
478 $(QUIET)$(RM) -f $@
479 $(QUIET)$(LN_SYMLINK) $< $@
480
481# rules for creating directories in archive (the pattern rules depends on these).
482BLDDIRS += $(foreach d,\
483 archive \
484 archive/components \
485 archive/helpers \
486 archive/nls \
487 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
488 $(if $(VBOX_WITH_PYTHON),\
489 archive/sdk/installer \
490 archive/sdk/installer/vboxapi \
491 archive/sdk/bindings/xpcom/python/xpcom \
492 archive/sdk/bindings/xpcom/python/xpcom/client \
493 archive/sdk/bindings/xpcom/python/xpcom/server,) \
494 $(if $(VBOX_WITH_JXPCOM),\
495 archive/sdk/bindings/xpcom/java,) \
496 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
497 archive/ExtensionPacks/VNC \
498 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
499 archive/additions \
500 install \
501 $(if $(VBOX_WITH_DTRACE),\
502 archive/dtrace \
503 archive/dtrace/lib \
504 archive/dtrace/lib/$(KBUILD_TARGET_ARCH) \
505 archive/dtrace/testcase/ \
506 archive/dtrace/testcase/$(KBUILD_TARGET_ARCH) \
507 archive/dtrace/scripts,) \
508,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
509
510
511#
512# .tar.bz2 for with the debug info.
513#
514$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
515 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
516 $(call MSG_L1,Packing $@)
517 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
518ifdef VBOX_USE_PBZIP2
519 $(QUIET)tar --dereference --owner 0 --group 0 \
520 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
521 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
522 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
523else
524 $(QUIET)tar --dereference --owner 0 --group 0 \
525 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
526 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
527endif
528
529# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
530$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
531 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
532 $(call MSG_TOOL,copydbg,$<,$@)
533 $(QUIET)objcopy --only-keep-debug $< $@
534
535# rules for creating directories in archive-dbg (the pattern rules depends on these).
536BLDDIRS += $(foreach d,\
537 $(VBOX_LNX_DBG_PATH) \
538 $(VBOX_LNX_DBG_PATH)/components \
539 $(VBOX_LNX_DBG_PATH)/helpers \
540,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
541
542include $(FILE_KBUILD_SUB_FOOTER)
543
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