VirtualBox

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

Last change on this file since 87163 was 86431, checked in by vboxsync, 4 years ago

Installer/linux: Include the sanitizer libs in 'asan' builds. 3rd try. bugref:9841

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