VirtualBox

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

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

VPX: dll => library

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