VirtualBox

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

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

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.9 KB
Line 
1# $Id: Makefile.kmk 98103 2023-01-17 14:15:46Z vboxsync $
2## @file
3# Makefile for the Linux installer.
4#
5
6#
7# Copyright (C) 2006-2023 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_LIBSSH),VBoxLibSsh.so,) \
164 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
165 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
166 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
167 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
168 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
169 VBoxHostChannel.so \
170 $(if $(VBOX_WITH_DRAG_AND_DROP),VBoxDragAndDropSvc.so,) \
171 $(if $(VBOX_WITH_MAIN), \
172 VBoxAutostart \
173 VBoxBalloonCtrl \
174 VBoxBugReport \
175 VBoxManage \
176 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
177 $(if $(VBOX_WITH_LWIP_NAT),VBoxNetNAT $(if $(VBOX_WITH_HARDENING),VBoxNetNAT.so,),) \
178 VBoxNetAdpCtl \
179 $(if $(VBOX_WITH_DEVMAPPER),VBoxVolInfo,) \
180 VBoxSVC \
181 VBoxXPCOM.so \
182 VBoxXPCOMC.so \
183 VBoxXPCOMIPCD \
184 components/VBoxXPCOMIPCC.so \
185 components/VBoxSVCM.so \
186 components/VBoxC.so,) \
187 $(if $(VBOX_WITH_QTGUI),VBoxTestOGL,) \
188 $(if $(VBOX_WITH_VMSVGA3D),VBoxSVGA3D.so,) \
189 $(if $(VBOX_WITH_DXVK), VBoxDxVk.so,) \
190 $(if $(VBOX_WITH_PYTHON),$(notdir $(wildcard $(PATH_STAGE_BIN)/VBoxPython*.so)),) \
191 $(if $(VBOX_WITH_JXPCOM),libvboxjxpcom.so,) \
192 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
193 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNC.so \
194 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNCMain.so,) \
195 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,)\
196 $(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),VBoxAudioTest,)
197
198# Do not remove relocation information of these binaries
199VBOX_LNX_STRIP_OBJ = \
200 VBoxDDR0.r0 \
201 VMMR0.r0
202ifdef VBOX_NO_LINUX_RUN_INSTALLER
203 VBOX_LNX_STRIP_OBJ += \
204 VBoxDDR0.debug \
205 VMMR0.debug
206else
207 VBOX_LNX_DBG_BIN = \
208 VBoxDDR0.debug \
209 VMMR0.debug
210endif
211
212ifdef VBOX_WITH_RAW_MODE
213 VBOX_LNX_STRIP_OBJ += \
214 VBoxDDRC.rc \
215 VMMRC.rc
216 ifdef VBOX_NO_LINUX_RUN_INSTALLER
217 VBOX_LNX_STRIP_OBJ += \
218 VBoxDDRC.debug \
219 VMMRC.debug
220 else
221 VBOX_LNX_DBG_BIN += \
222 VBoxDDRC.debug \
223 VMMRC.debug
224 endif
225endif
226
227# Do not strip anything of these files
228VBOX_LNX_NO_STRIP = \
229 $(if $(VBOX_OSE),,LICENSE) \
230 $(if $(VBOX_WITH_MAIN), \
231 components/VBoxXPCOMBase.xpt \
232 components/VirtualBox_XPCOM.xpt) \
233 $(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
234 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
235 ExtensionPacks/VNC/ExtPack.xml \
236 ExtensionPacks/VNC/ExtPack-license.html \
237 ExtensionPacks/VNC/ExtPack-license.rtf \
238 ExtensionPacks/VNC/ExtPack-license.txt,) \
239 check_module_dependencies.sh \
240 postinst-common.sh \
241 prerm-common.sh \
242 routines.sh \
243 VBoxSysInfo.sh \
244 vboxautostart-service.sh \
245 vboxballoonctrl-service.sh \
246 VBoxCreateUSBNode.sh \
247 vboxdrv.sh \
248 VBox.sh \
249 vboxweb-service.sh \
250 VBox.png \
251 $(addprefix UnattendedTemplates/,$(VBOX_UNATTENDED_TEMPLATES))
252
253ifdef VBOX_WITH_EXTPACK
254 VBOX_LNX_STRIP_BIN += \
255 VBoxExtPackHelperApp
256endif
257
258# Qt GUI
259ifdef VBOX_WITH_QTGUI
260 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
261 VBOX_LNX_STRIP_BIN += \
262 VBoxKeyboard.so \
263 VirtualBox \
264 VirtualBoxVM \
265 UICommon.so \
266 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so DbgPlugInDiggers.so)
267 ifdef VBOX_WITH_HARDENING
268 VBOX_LNX_STRIP_BIN += \
269 VirtualBoxVM.so
270 endif
271 VBOX_LNX_NO_STRIP += \
272 virtualbox.desktop \
273 virtualboxvm.desktop \
274 virtualbox.xml \
275 $(VBOX_LICENSE_FILES) \
276 $(if $(VBOX_WITH_ORACLE_QT),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
277 $(if $(VBOX_WITH_ORACLE_QT),$(VBOX_QT_PLUGINS)) \
278 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm) \
279 icons
280endif
281
282# Guest Additions
283ifdef VBOX_WITH_ADDITIONS_PACKING
284 VBOX_LNX_NO_STRIP += \
285 additions/VBoxGuestAdditions.iso
286endif
287
288# Documentation
289ifdef VBOX_WITH_DOCS_PACKING
290 VBOX_LNX_NO_STRIP += \
291 UserManual.pdf \
292 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).pdf)
293 ifdef VBOX_WITH_DOCS_CHM_PACKING
294 VBOX_LNX_NO_STRIP += \
295 VirtualBox.chm \
296 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm)
297 endif
298 ifdef VBOX_WITH_DOCS_QHELP_PACKING
299 VBOX_LNX_NO_STRIP += \
300 UserManual.qch UserManual.qhc \
301 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).qch ,UserManual_$(f).qhc)
302 endif
303endif
304
305# auth stuff
306VBOX_LNX_STRIP_BIN += \
307 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
308 VBoxAuthSimple.so
309
310# VRDP
311ifdef VBOX_WITH_VRDP
312 ifndef VBOX_WITH_EXTPACK_PUEL
313 VBOX_LNX_STRIP_BIN += \
314 VBoxVRDP.so
315 endif
316endif
317
318# Python XPCOM glue
319ifdef VBOX_WITH_PYTHON
320 VBOX_LNX_NO_STRIP += \
321 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
322 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
323endif
324
325# Java XPCOM bridge
326ifdef VBOX_WITH_JXPCOM
327 VBOX_LNX_NO_STRIP += \
328 sdk/bindings/xpcom/java/vboxjxpcom.jar
329endif
330
331# Headless
332ifdef VBOX_WITH_HEADLESS
333 VBOX_LNX_STRIP_BIN += \
334 VBoxHeadless \
335 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
336endif
337
338# Webservices
339ifdef VBOX_WITH_WEBSERVICES
340 VBOX_LNX_STRIP_BIN += \
341 vboxwebsrv
342endif
343
344# vbox-img
345if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
346 VBOX_LNX_STRIP_BIN += \
347 vbox-img
348endif
349
350# vboximg-mount
351if defined(VBOX_WITH_VBOXIMGMOUNT)
352 VBOX_LNX_STRIP_BIN += \
353 vboximg-mount
354endif
355
356# EFI firmware
357ifdef VBOX_WITH_EFIFW_PACKING
358 VBOX_LNX_NO_STRIP += \
359 VBoxEFI32.fd \
360 VBoxEFI64.fd
361endif
362
363# DTrace library and scripts.
364ifdef VBOX_WITH_DTRACE
365 VBOX_LNX_NO_STRIP += \
366 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
367 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
368 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
369endif
370
371# The sanitizer shared objects match the compiler we're using (HACK).
372ifeq ($(KBUILD_TYPE),asan)
373 VBOX_LNX_NO_STRIP += $(notdir $(VBOX_GCC_SANITIZER_SO_FILES))
374endif
375
376# Icons
377VBOX_MIME_ICONS = \
378 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/other/,\
379 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
380 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
381 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
382
383VBOX_DESKTOP_ICONS = \
384 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/$(if $(VBOX_OSE),OSE,NonOSE)/,\
385 $(foreach s,16 20 32 40 48 64 128,\
386 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
387 virtualbox.svg=>scalable/virtualbox.svg)
388
389#
390# All the bin files that goes into the archives.
391#
392VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
393
394# Cleanup of the files we copy/symlink from bin.
395OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(filter-out src,$(VBOX_LNX_ARCH_FILES)) src/vboxhost) \
396 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
397 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
398
399#
400# The generic installer.
401#
402$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
403 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
404 $(VBOX_VERSION_STAMP) \
405 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
406 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
407 $$(linux-scripts_2_STAGE_TARGETS)
408 $(call MSG_TOOL,makeself,,$@)
409 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
410 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
411 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
412 $(QUIET)$(RM) -f $@
413 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
414 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
415
416$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) $(wildcard $(VBOX_SVN_REV_KMK).ts) | $$(dir $$@)
417 $(QUIET)$(SED) \
418 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
419 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
420 -e "s;_BUILD_;$(date-utc );g" \
421 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
422 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
423 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
424 -e "s;_USERNAME_;$(USERNAME);g" \
425 -e "s;_INSTALLATION_DIR_;$(VBOX_LNX_APP_PRIVATE);g" \
426 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
427 --output $@ \
428 $<
429
430#
431# The files that the tar archives depend on.
432#
433
434include $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/files_vboxdrv
435VBOX_LNX_INST_FILES_VBOXDRV=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxdrv/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXDRV_NOBIN)))))
436include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
437VBOX_LNX_INST_FILES_VBOXNETFLT=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetflt/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)))))
438include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
439VBOX_LNX_INST_FILES_VBOXNETADP=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetadp/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)))))
440
441ifdef VBOX_WITH_PCI_PASSTHROUGH
442 include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci
443 VBOX_LNX_INST_FILES_VBOXPCI=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxpci/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXPCI_SOURCES)))))
444endif
445
446VBOX_LNX_INST_ARCH_DEPS := \
447 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
448 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
449 $(VBOX_VERSION_STAMP) \
450 $(VBOX_LNX_INST_FILES_VBOXDRV) \
451 $(VBOX_LNX_INST_FILES_VBOXNETFLT) \
452 $(VBOX_LNX_INST_FILES_VBOXNETADP) \
453 $(if $(VBOX_WITH_PCI_PASSTHROUGH),$(VBOX_LNX_INST_FILES_VBOXPCI),)
454
455#
456# .tar.bz2 for converting into .run
457#
458$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
459 $(call MSG_L1,Packing $@)
460 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
461 $(QUIET)$(MKDIR) -p $(@D)
462ifdef VBOX_USE_PBZIP2
463 $(QUIET)tar --dereference --owner 0 --group 0 \
464 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
465 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
466else
467 $(QUIET)tar --dereference --owner 0 --group 0 \
468 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
469endif
470 $(QUIET)$(CHMOD) 0644 $@
471
472#
473# .tar for distribution with the files under VirtualBox-<ver>/.
474#
475$(PATH_STAGE_BIN)/VirtualBox.tar: $(VBOX_LNX_INST_ARCH_DEPS)
476 $(call MSG_L1,Packing $@)
477 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
478 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
479 $(QUIET)tar --dereference --owner 0 --group 0 \
480 -cRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
481 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
482 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
483
484
485# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
486$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
487 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
488 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
489 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
490 | $$(dir $$@)
491 $(call MSG_INST_FILE,$<,$@)
492 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
493 $(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),$@) $@)
494
495# pattern rule for copying VBOX_LNX_DBG_BIN files to archive-dbg/
496$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_DBG_BIN)): \
497 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
498 $(call MSG_INST_FILE,$<,$@)
499 $(QUIET)$(CP) $< $@
500
501# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
502$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
503 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
504 $(call MSG_INST_FILE,$<,$@)
505ifeq ($(VBOX_DO_STRIP),)
506 $(QUIET)$(INSTALL) -m 0644 $< $@
507else # strip to temp file because of umask.
508 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
509 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
510 $(QUIET)$(RM) -f -- $@.tmp
511endif
512
513# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
514$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
515 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
516 $(call MSG_INST_SYM,$<,$@)
517 $(QUIET)$(RM) -f $@
518 $(QUIET)$(LN_SYMLINK) $< $@
519
520# special rule for the kernel modules
521$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
522 $(call MSG_INST_SYM,$<,$@)
523 $(QUIET)$(RM) -Rf $@
524 $(QUIET)$(MKDIR) $@
525 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
526
527# rules for creating directories in archive (the pattern rules depends on these).
528BLDDIRS += $(foreach d,\
529 archive \
530 archive/components \
531 archive/nls \
532 $(if $(VBOX_WITH_UNATTENDED),archive/unattended_templates,) \
533 $(if $(VBOX_WITH_ORACLE_QT), \
534 archive/plugins/platforms \
535 archive/plugins/platformthemes \
536 archive/plugins/sqldrivers \
537 archive/plugins/styles \
538 archive/plugins/xcbglintegrations,) \
539 $(if $(VBOX_WITH_PYTHON),\
540 archive/sdk/installer \
541 archive/sdk/installer/vboxapi \
542 archive/sdk/bindings/xpcom/python/xpcom \
543 archive/sdk/bindings/xpcom/python/xpcom/client \
544 archive/sdk/bindings/xpcom/python/xpcom/server,) \
545 $(if $(VBOX_WITH_JXPCOM),\
546 archive/sdk/bindings/xpcom/java,) \
547 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
548 archive/ExtensionPacks/VNC \
549 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
550 archive/additions \
551 $(if-expr defined(VBOX_UNATTENDED_TEMPLATES),archive/UnattendedTemplates,) \
552 install \
553 $(if $(VBOX_WITH_DTRACE),\
554 archive/dtrace \
555 archive/dtrace/lib \
556 archive/dtrace/lib/$(KBUILD_TARGET_ARCH) \
557 archive/dtrace/testcase/ \
558 archive/dtrace/testcase/$(KBUILD_TARGET_ARCH) \
559 archive/dtrace/scripts,) \
560,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
561
562
563#
564# .tar.bz2 for with the debug info.
565#
566$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
567 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
568 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
569 $(call MSG_L1,Packing $@)
570 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
571ifdef VBOX_USE_PBZIP2
572 $(QUIET)tar --dereference --owner 0 --group 0 \
573 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
574 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
575 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
576else
577 $(QUIET)tar --dereference --owner 0 --group 0 \
578 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
579 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
580endif
581
582# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
583$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
584 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
585 $(call MSG_TOOL,copydbg,$<,$@)
586 $(QUIET)objcopy --only-keep-debug $< $@
587
588# rules for creating directories in archive-dbg (the pattern rules depends on these).
589BLDDIRS += $(foreach d,\
590 $(VBOX_LNX_DBG_PATH) \
591 $(VBOX_LNX_DBG_PATH)/components \
592,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
593
594include $(FILE_KBUILD_SUB_FOOTER)
595
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