VirtualBox

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

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

Installer/linux: first version of headless X.Org runner script, fully un-tested.

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