VirtualBox

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

Last change on this file since 51287 was 50142, checked in by vboxsync, 11 years ago

Installer/linux and FE/Qt: move SVG icon to Resources and add it to the Linux installer.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.6 KB
Line 
1# $Id: Makefile.kmk 50142 2014-01-21 16:44:29Z 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_PYTHON),$(notdir $(wildcard $(PATH_STAGE_BIN)/VBoxPython*.so)),) \
170 $(if $(VBOX_WITH_JXPCOM),libvboxjxpcom.so,) \
171 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
172 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNC.so \
173 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNCMain.so,) \
174 VBoxTunctl \
175 helpers/generate_service_file
176
177# Do not remove relocation information of these binaries
178VBOX_LNX_STRIP_OBJ = \
179 VBoxDD2R0.r0 \
180 VBoxDDR0.r0 \
181 VMMR0.r0
182
183ifdef VBOX_WITH_RAW_MODE
184 VBOX_LNX_STRIP_OBJ += \
185 VBoxDD2GC.gc \
186 VBoxDDGC.gc \
187 VMMGC.gc
188endif
189
190# Do not strip anything of these files
191VBOX_LNX_NO_STRIP = \
192 $(if $(VBOX_OSE),,LICENSE) \
193 $(if $(VBOX_WITH_MAIN), \
194 components/VBoxXPCOMBase.xpt \
195 components/VirtualBox_XPCOM.xpt) \
196 $(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
197 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
198 ExtensionPacks/VNC/ExtPack.xml \
199 ExtensionPacks/VNC/ExtPack-license.html \
200 ExtensionPacks/VNC/ExtPack-license.rtf \
201 ExtensionPacks/VNC/ExtPack-license.txt,) \
202 VBoxSysInfo.sh \
203 VBoxCreateUSBNode.sh \
204 VBox.sh \
205 VBox.png \
206 scripts
207
208ifdef VBOX_WITH_EXTPACK
209 VBOX_LNX_STRIP_BIN += \
210 VBoxExtPackHelperApp
211endif
212
213# Qt4 GUI
214ifdef VBOX_WITH_QTGUI
215 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
216 VBOX_LNX_STRIP_BIN += \
217 VBoxKeyboard.so \
218 VirtualBox \
219 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
220 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
221 VBOX_LNX_NO_STRIP += \
222 virtualbox.desktop \
223 virtualbox.xml \
224 $(VBOX_LICENSE_FILES) \
225 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
226 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
227 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm) \
228 icons
229endif
230
231# Guest Additions
232ifdef VBOX_WITH_ADDITIONS_PACKING
233 VBOX_LNX_NO_STRIP += \
234 additions/VBoxGuestAdditions.iso
235endif
236
237# Documentation
238ifdef VBOX_WITH_DOCS_PACKING
239 VBOX_LNX_NO_STRIP += \
240 UserManual.pdf \
241 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).pdf)
242 ifdef VBOX_WITH_DOCS_CHM
243 VBOX_LNX_NO_STRIP += \
244 VirtualBox.chm \
245 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm)
246 endif
247 VBOX_LNX_STRIP_BIN += \
248 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
249endif
250
251# auth stuff
252VBOX_LNX_STRIP_BIN += \
253 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
254 VBoxAuthSimple.so
255
256# VRDP
257ifdef VBOX_WITH_VRDP
258 ifndef VBOX_WITH_EXTPACK_PUEL
259 VBOX_LNX_STRIP_BIN += \
260 VBoxVRDP.so
261 endif
262 ifdef VBOX_WITH_VRDP_RDESKTOP
263 VBOX_LNX_NO_STRIP += \
264 rdesktop-vrdp.tar.gz
265 VBOX_LNX_NO_STRIP += \
266 rdesktop-vrdp-keymaps
267 VBOX_LNX_STRIP_BIN += \
268 rdesktop-vrdp
269 endif
270endif
271
272# Python XPCOM glue
273ifdef VBOX_WITH_PYTHON
274 VBOX_LNX_NO_STRIP += \
275 $(foreach f,$(notdir $(wildcard $(PATH_STAGE_BIN)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
276 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
277 sdk/bindings/xpcom/python/xpcom/server/__init__.py \
278 sdk/bindings/xpcom/python/xpcom/server/enumerator.py \
279 sdk/bindings/xpcom/python/xpcom/server/factory.py \
280 sdk/bindings/xpcom/python/xpcom/server/loader.py \
281 sdk/bindings/xpcom/python/xpcom/server/module.py \
282 sdk/bindings/xpcom/python/xpcom/server/policy.py \
283 sdk/installer/vboxapisetup.py \
284 sdk/installer/vboxapi/__init__.py \
285 sdk/installer/vboxapi/VirtualBox_constants.py
286endif
287
288# Java XPCOM bridge
289ifdef VBOX_WITH_JXPCOM
290 VBOX_LNX_NO_STRIP += \
291 sdk/bindings/xpcom/java/vboxjxpcom.jar
292endif
293
294# Headless
295ifdef VBOX_WITH_HEADLESS
296 VBOX_LNX_STRIP_BIN += \
297 VBoxHeadless \
298 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
299endif
300
301# Webservices
302ifdef VBOX_WITH_WEBSERVICES
303 VBOX_LNX_STRIP_BIN += \
304 vboxwebsrv \
305 webtest
306endif
307
308# EFI firmware
309ifdef VBOX_WITH_EFIFW_PACKING
310 VBOX_LNX_NO_STRIP += \
311 VBoxEFI32.fd \
312 VBoxEFI64.fd
313endif
314
315VBOX_MIME_ICONS = \
316 $(addprefix $(PATH_ROOT)/src/VBox/Resources/other/,\
317 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
318 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
319 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
320
321VBOX_DESKTOP_ICONS = \
322 $(addprefix $(PATH_ROOT)/src/VBox/Resources/$(if $(VBOX_OSE),OSE,NonOSE)/,\
323 $(foreach s,16 20 32 40 48 64 128,\
324 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
325 virtualbox.svg=>scalable/virtualbox.svg)
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 $(wildcard $(PATH_STAGE_BIN)/scripts/*)
398
399
400#
401# .tar.bz2 for converting into .run
402#
403$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
404 $(call MSG_L1,Packing $@)
405 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
406 $(QUIET)$(MKDIR) -p $(@D)
407ifdef VBOX_USE_PBZIP2
408 $(QUIET)tar --dereference --owner 0 --group 0 \
409 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
410 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
411else
412 $(QUIET)tar --dereference --owner 0 --group 0 \
413 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
414endif
415 $(QUIET)$(CHMOD) 0644 $@
416
417#
418# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
419#
420$(PATH_STAGE_BIN)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
421 $(call MSG_L1,Packing $@)
422 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
423 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
424ifdef VBOX_USE_PBZIP2
425 $(QUIET)tar --dereference --owner 0 --group 0 \
426 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
427 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
428 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
429else
430 $(QUIET)tar --dereference --owner 0 --group 0 \
431 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
432 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
433endif
434 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
435
436
437# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
438$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
439 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
440 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
441 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
442 | $$(dir $$@)
443 $(call MSG_INST_FILE,$<,$@)
444 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
445 $(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),$@) $@)
446
447# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
448$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
449 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
450 $(call MSG_INST_FILE,$<,$@)
451ifeq ($(VBOX_DO_STRIP),)
452 $(QUIET)$(INSTALL) -m 0644 $< $@
453else # strip to temp file because of umask.
454 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
455 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
456 $(QUIET)$(RM) -f -- $@.tmp
457endif
458
459# special rule for the kernel modules
460$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
461 $(call MSG_INST_SYM,$<,$@)
462 $(QUIET)$(RM) -Rf $@
463 $(QUIET)$(MKDIR) $@
464 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
465
466# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
467$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
468 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
469 $(call MSG_INST_SYM,$<,$@)
470 $(QUIET)$(RM) -f $@
471 $(QUIET)$(LN_SYMLINK) $< $@
472
473# rules for creating directories in archive (the pattern rules depends on these).
474BLDDIRS += $(foreach d,\
475 archive \
476 archive/components \
477 archive/helpers \
478 archive/nls \
479 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
480 $(if $(VBOX_WITH_PYTHON),\
481 archive/sdk/installer \
482 archive/sdk/installer/vboxapi \
483 archive/sdk/bindings/xpcom/python/xpcom \
484 archive/sdk/bindings/xpcom/python/xpcom/client \
485 archive/sdk/bindings/xpcom/python/xpcom/server,) \
486 $(if $(VBOX_WITH_JXPCOM),\
487 archive/sdk/bindings/xpcom/java,) \
488 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
489 archive/ExtensionPacks/VNC \
490 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
491 archive/additions \
492 install\
493,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
494
495
496#
497# .tar.bz2 for with the debug info.
498#
499$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
500 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
501 $(call MSG_L1,Packing $@)
502 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
503ifdef VBOX_USE_PBZIP2
504 $(QUIET)tar --dereference --owner 0 --group 0 \
505 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
506 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
507 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
508else
509 $(QUIET)tar --dereference --owner 0 --group 0 \
510 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
511 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
512endif
513
514# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
515$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
516 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
517 $(call MSG_TOOL,copydbg,$<,$@)
518 $(QUIET)objcopy --only-keep-debug $< $@
519
520# rules for creating directories in archive-dbg (the pattern rules depends on these).
521BLDDIRS += $(foreach d,\
522 $(VBOX_LNX_DBG_PATH) \
523 $(VBOX_LNX_DBG_PATH)/components \
524 $(VBOX_LNX_DBG_PATH)/helpers \
525,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
526
527include $(FILE_KBUILD_SUB_FOOTER)
528
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