VirtualBox

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

Last change on this file since 58403 was 58403, checked in by vboxsync, 9 years ago

#8051: Installers: unify Linux host installers as far as possible: while this is not strictly part of this task, we now install the check_module_dependencies.sh script as part of all Linux host package types. This script examines the system and prints out the yum/apt-get command lines needed to install any missing kernel module build dependencies. It can optionally execute the commands too. It is currently missing perl, which is needed on certain RedHat-based systems.

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