VirtualBox

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

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

header (C) fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.7 KB
Line 
1# $Id: Makefile.kmk 44528 2013-02-04 14:27:54Z 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## VBoxBFE - Not shipped on linux due to a typo (VBOX_WITH_BFE), let's keep it that way as it doesn't get enough testing.
300#ifdef VBOX_WITH_VBOXBFE
301# VBOX_LNX_STRIP_BIN += \
302# VBoxBFE \
303# $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
304#endif
305
306# Webservices
307ifdef VBOX_WITH_WEBSERVICES
308 VBOX_LNX_STRIP_BIN += \
309 vboxwebsrv \
310 webtest
311endif
312
313# EFI firmware
314ifdef VBOX_WITH_EFIFW_PACKING
315 VBOX_LNX_NO_STRIP += \
316 VBoxEFI32.fd \
317 VBoxEFI64.fd
318endif
319
320VBOX_MIME_ICONS = \
321 $(addprefix $(PATH_ROOT)/src/VBox/Resources/other/,\
322 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
323 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
324 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
325
326VBOX_DESKTOP_ICONS = \
327 $(addprefix $(PATH_ROOT)/src/VBox/Resources/$(if $(VBOX_OSE),OSE,NonOSE)/,\
328 $(foreach s,16 20 32 40 48 64 128,\
329 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png))
330
331#
332# All the bin files that goes into the archives.
333#
334VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
335
336# Cleanup of the files we copy/symlink from bin.
337OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
338 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
339
340#
341# The generic installer.
342#
343$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
344 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
345 $(VBOX_VERSION_STAMP) \
346 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
347 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
348 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
349 $(VBOX_PATH_LNX_INST_SRC)/installer-common.sh \
350 $$(linux-scripts_2_STAGE_TARGETS)
351 $(call MSG_TOOL,makeself,,$@)
352 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
353 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
354 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
355 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
356 $(QUIET)$(RM) -f $@
357 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
358 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
359
360# files that needs editing before they can be included in the generic installer.
361$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
362 $(QUIET)$(SED_EXT) \
363 -e "s|%NOLSB%|yes|g" \
364 -e "s|%DEBIAN%||g" \
365 -e "s|%PACKAGE%|virtualbox|g" \
366 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
367 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
368 --output $@ \
369 $<
370
371$(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 $$@)
372 $(QUIET)$(SED) \
373 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
374 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
375 -e "s;_BUILD_;$(date-utc );g" \
376 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
377 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
378 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
379 -e "s;_USERNAME_;$(USERNAME);g" \
380 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
381 -e '/#include installer-common.sh/ {' \
382 -e "r $(PATH_ROOT)/src/VBox/Installer/linux/installer-common.sh" \
383 -e 'd' \
384 -e '}' \
385 --output $@ \
386 $<
387
388#
389# The files that the tar archives depend on. The wildcards are ugly, but they
390# do save us from having to update the makefile whenever something new is added
391# to the module source directories.
392#
393VBOX_LNX_INST_ARCH_DEPS := \
394 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
395 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
396 $(VBOX_VERSION_STAMP) \
397 $(wildcard $(PATH_STAGE_BIN)/src/*) \
398 $(wildcard $(PATH_STAGE_BIN)/src/*/*) \
399 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*) \
400 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*/*) \
401 $(wildcard $(PATH_STAGE_BIN)/scripts/*)
402
403
404#
405# .tar.bz2 for converting into .run
406#
407$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
408 $(call MSG_L1,Packing $@)
409 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
410 $(QUIET)$(MKDIR) -p $(@D)
411ifdef VBOX_USE_PBZIP2
412 $(QUIET)tar --dereference --owner 0 --group 0 \
413 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
414 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
415else
416 $(QUIET)tar --dereference --owner 0 --group 0 \
417 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
418endif
419 $(QUIET)$(CHMOD) 0644 $@
420
421#
422# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
423#
424$(PATH_STAGE_BIN)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
425 $(call MSG_L1,Packing $@)
426 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
427 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
428ifdef VBOX_USE_PBZIP2
429 $(QUIET)tar --dereference --owner 0 --group 0 \
430 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
431 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
432 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
433else
434 $(QUIET)tar --dereference --owner 0 --group 0 \
435 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
436 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
437endif
438 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
439
440
441# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
442$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
443 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
444 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
445 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
446 | $$(dir $$@)
447 $(call MSG_INST_FILE,$<,$@)
448 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
449 $(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),$@) $@)
450
451# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
452$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
453 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
454 $(call MSG_INST_FILE,$<,$@)
455ifeq ($(VBOX_DO_STRIP),)
456 $(QUIET)$(INSTALL) -m 0644 $< $@
457else # strip to temp file because of umask.
458 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
459 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
460 $(QUIET)$(RM) -f -- $@.tmp
461endif
462
463# special rule for the kernel modules
464$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
465 $(call MSG_INST_SYM,$<,$@)
466 $(QUIET)$(RM) -Rf $@
467 $(QUIET)$(MKDIR) $@
468 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
469
470# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
471$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
472 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
473 $(call MSG_INST_SYM,$<,$@)
474 $(QUIET)$(RM) -f $@
475 $(QUIET)$(LN_SYMLINK) $< $@
476
477# rules for creating directories in archive (the pattern rules depends on these).
478BLDDIRS += $(foreach d,\
479 archive \
480 archive/components \
481 archive/helpers \
482 archive/nls \
483 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
484 $(if $(VBOX_WITH_PYTHON),\
485 archive/sdk/installer \
486 archive/sdk/installer/vboxapi \
487 archive/sdk/bindings/xpcom/python/xpcom \
488 archive/sdk/bindings/xpcom/python/xpcom/client \
489 archive/sdk/bindings/xpcom/python/xpcom/server,) \
490 $(if $(VBOX_WITH_JXPCOM),\
491 archive/sdk/bindings/xpcom/java,) \
492 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
493 archive/ExtensionPacks/VNC \
494 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
495 archive/additions \
496 install\
497,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
498
499
500#
501# .tar.bz2 for with the debug info.
502#
503$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
504 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
505 $(call MSG_L1,Packing $@)
506 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
507ifdef VBOX_USE_PBZIP2
508 $(QUIET)tar --dereference --owner 0 --group 0 \
509 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
510 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
511 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
512else
513 $(QUIET)tar --dereference --owner 0 --group 0 \
514 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
515 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
516endif
517
518# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
519$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
520 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
521 $(call MSG_TOOL,copydbg,$<,$@)
522 $(QUIET)objcopy --only-keep-debug $< $@
523
524# rules for creating directories in archive-dbg (the pattern rules depends on these).
525BLDDIRS += $(foreach d,\
526 $(VBOX_LNX_DBG_PATH) \
527 $(VBOX_LNX_DBG_PATH)/components \
528 $(VBOX_LNX_DBG_PATH)/helpers \
529,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
530
531include $(FILE_KBUILD_SUB_FOOTER)
532
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