VirtualBox

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

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

VBoxBFE: RIP.

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