VirtualBox

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

Last change on this file since 96407 was 96407, checked in by vboxsync, 2 years ago

scm copyright and license note update

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