VirtualBox

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

Last change on this file since 99844 was 99040, checked in by vboxsync, 21 months ago

*.kmk: Applied scm with new indenting of multiline variable/function expansions in variable assignments. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.0 KB
Line 
1# $Id: Makefile.kmk 99040 2023-03-18 21:03:42Z 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 $(if $(VBOX_WITH_FE_AUTOSTART),vboxautostart-service.sh) \
88 $(if $(VBOX_WITH_FE_BALLOONCTRL),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 $(if $(VBOX_WITH_FE_AUTOSTART),vboxautostart-service.sh) \
105 $(if $(VBOX_WITH_FE_BALLOONCTRL),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)
120 linux-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 $(if $(VBOX_WITH_FE_AUTOSTART),VBoxAutostart,) \
173 $(if $(VBOX_WITH_FE_BALLOONCTRL),VBoxBalloonCtrl,) \
174 $(if $(VBOX_WITH_FE_BUGREPORT),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 $(if $(VBOX_WITH_FE_AUTOSTART),vboxautostart-service.sh) \
245 $(if $(VBOX_WITH_FE_BALLOONCTRL),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_QHELP_PACKING
294 VBOX_LNX_NO_STRIP += \
295 UserManual.qch UserManual.qhc \
296 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).qch ,UserManual_$(f).qhc)
297 endif
298endif
299
300# auth stuff
301VBOX_LNX_STRIP_BIN += \
302 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
303 VBoxAuthSimple.so
304
305# VRDP
306ifdef VBOX_WITH_VRDP
307 ifndef VBOX_WITH_EXTPACK_PUEL
308 VBOX_LNX_STRIP_BIN += \
309 VBoxVRDP.so
310 endif
311endif
312
313# Python XPCOM glue
314ifdef VBOX_WITH_PYTHON
315 VBOX_LNX_NO_STRIP += \
316 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
317 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
318endif
319
320# Java XPCOM bridge
321ifdef VBOX_WITH_JXPCOM
322 VBOX_LNX_NO_STRIP += \
323 sdk/bindings/xpcom/java/vboxjxpcom.jar
324endif
325
326# Headless
327ifdef VBOX_WITH_HEADLESS
328 VBOX_LNX_STRIP_BIN += \
329 VBoxHeadless \
330 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
331endif
332
333# Webservices
334ifdef VBOX_WITH_WEBSERVICES
335 VBOX_LNX_STRIP_BIN += \
336 vboxwebsrv
337endif
338
339# vbox-img
340if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
341 VBOX_LNX_STRIP_BIN += \
342 vbox-img
343endif
344
345# vboximg-mount
346if defined(VBOX_WITH_VBOXIMGMOUNT)
347 VBOX_LNX_STRIP_BIN += \
348 vboximg-mount
349endif
350
351# EFI firmware
352ifdef VBOX_WITH_EFIFW_PACKING
353 VBOX_LNX_NO_STRIP += \
354 VBoxEFI32.fd \
355 VBoxEFI64.fd
356endif
357
358# DTrace library and scripts.
359ifdef VBOX_WITH_DTRACE
360 VBOX_LNX_NO_STRIP += \
361 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
362 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
363 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
364endif
365
366# The sanitizer shared objects match the compiler we're using (HACK).
367ifeq ($(KBUILD_TYPE),asan)
368 VBOX_LNX_NO_STRIP += $(notdir $(VBOX_GCC_SANITIZER_SO_FILES))
369endif
370
371# Icons
372VBOX_MIME_ICONS = \
373 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/other/, \
374 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
375 $(foreach s,16 20 24 32 48 64 72 96 128 256, \
376 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
377
378VBOX_DESKTOP_ICONS = \
379 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/$(if $(VBOX_OSE),OSE,NonOSE)/, \
380 $(foreach s,16 20 32 40 48 64 128, \
381 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
382 virtualbox.svg=>scalable/virtualbox.svg)
383
384#
385# All the bin files that goes into the archives.
386#
387VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
388
389# Cleanup of the files we copy/symlink from bin.
390OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(filter-out src,$(VBOX_LNX_ARCH_FILES)) src/vboxhost) \
391 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, \
392 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
393
394#
395# The generic installer.
396#
397$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
398 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
399 $(VBOX_VERSION_STAMP) \
400 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
401 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
402 $$(linux-scripts_2_STAGE_TARGETS)
403 $(call MSG_TOOL,makeself,,$@)
404 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
405 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
406 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
407 $(QUIET)$(RM) -f $@
408 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
409 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
410
411$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) $(wildcard $(VBOX_SVN_REV_KMK).ts) | $$(dir $$@)
412 $(QUIET)$(SED) \
413 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
414 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
415 -e "s;_BUILD_;$(date-utc );g" \
416 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
417 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
418 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
419 -e "s;_USERNAME_;$(USERNAME);g" \
420 -e "s;_INSTALLATION_DIR_;$(VBOX_LNX_APP_PRIVATE);g" \
421 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
422 --output $@ \
423 $<
424
425#
426# The files that the tar archives depend on.
427#
428
429include $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/files_vboxdrv
430VBOX_LNX_INST_FILES_VBOXDRV = $(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxdrv/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXDRV_NOBIN)))))
431include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
432VBOX_LNX_INST_FILES_VBOXNETFLT = $(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetflt/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)))))
433include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
434VBOX_LNX_INST_FILES_VBOXNETADP = $(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetadp/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)))))
435
436ifdef VBOX_WITH_PCI_PASSTHROUGH
437 include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci
438 VBOX_LNX_INST_FILES_VBOXPCI = $(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxpci/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXPCI_SOURCES)))))
439endif
440
441VBOX_LNX_INST_ARCH_DEPS := \
442 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
443 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
444 $(VBOX_VERSION_STAMP) \
445 $(VBOX_LNX_INST_FILES_VBOXDRV) \
446 $(VBOX_LNX_INST_FILES_VBOXNETFLT) \
447 $(VBOX_LNX_INST_FILES_VBOXNETADP) \
448 $(if $(VBOX_WITH_PCI_PASSTHROUGH),$(VBOX_LNX_INST_FILES_VBOXPCI),)
449
450#
451# .tar.bz2 for converting into .run
452#
453$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
454 $(call MSG_L1,Packing $@)
455 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
456 $(QUIET)$(MKDIR) -p $(@D)
457ifdef VBOX_USE_PBZIP2
458 $(QUIET)tar --dereference --owner 0 --group 0 \
459 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
460 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
461else
462 $(QUIET)tar --dereference --owner 0 --group 0 \
463 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
464endif
465 $(QUIET)$(CHMOD) 0644 $@
466
467#
468# .tar for distribution with the files under VirtualBox-<ver>/.
469#
470$(PATH_STAGE_BIN)/VirtualBox.tar: $(VBOX_LNX_INST_ARCH_DEPS)
471 $(call MSG_L1,Packing $@)
472 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
473 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
474 $(QUIET)tar --dereference --owner 0 --group 0 \
475 -cRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
476 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
477 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
478
479
480# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
481$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
482 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
483 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),, \
484 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
485 | $$(dir $$@)
486 $(call MSG_INST_FILE,$<,$@)
487 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
488 $(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),$@) $@)
489
490# pattern rule for copying VBOX_LNX_DBG_BIN files to archive-dbg/
491$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_DBG_BIN)): \
492 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
493 $(call MSG_INST_FILE,$<,$@)
494 $(QUIET)$(CP) $< $@
495
496# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
497$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
498 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
499 $(call MSG_INST_FILE,$<,$@)
500ifeq ($(VBOX_DO_STRIP),)
501 $(QUIET)$(INSTALL) -m 0644 $< $@
502else # strip to temp file because of umask.
503 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
504 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
505 $(QUIET)$(RM) -f -- [email protected]
506endif
507
508# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
509$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
510 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
511 $(call MSG_INST_SYM,$<,$@)
512 $(QUIET)$(RM) -f $@
513 $(QUIET)$(LN_SYMLINK) $< $@
514
515# special rule for the kernel modules
516$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
517 $(call MSG_INST_SYM,$<,$@)
518 $(QUIET)$(RM) -Rf $@
519 $(QUIET)$(MKDIR) $@
520 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
521
522# rules for creating directories in archive (the pattern rules depends on these).
523BLDDIRS += $(foreach d, \
524 archive \
525 archive/components \
526 archive/nls \
527 $(if $(VBOX_WITH_UNATTENDED),archive/unattended_templates,) \
528 $(if $(VBOX_WITH_ORACLE_QT), \
529 archive/plugins/platforms \
530 archive/plugins/platformthemes \
531 archive/plugins/sqldrivers \
532 archive/plugins/styles \
533 archive/plugins/xcbglintegrations,) \
534 $(if $(VBOX_WITH_PYTHON), \
535 archive/sdk/installer \
536 archive/sdk/installer/vboxapi \
537 archive/sdk/bindings/xpcom/python/xpcom \
538 archive/sdk/bindings/xpcom/python/xpcom/client \
539 archive/sdk/bindings/xpcom/python/xpcom/server,) \
540 $(if $(VBOX_WITH_JXPCOM), \
541 archive/sdk/bindings/xpcom/java,) \
542 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
543 archive/ExtensionPacks/VNC \
544 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
545 archive/additions \
546 $(if-expr defined(VBOX_UNATTENDED_TEMPLATES),archive/UnattendedTemplates,) \
547 install \
548 $(if $(VBOX_WITH_DTRACE), \
549 archive/dtrace \
550 archive/dtrace/lib \
551 archive/dtrace/lib/$(KBUILD_TARGET_ARCH) \
552 archive/dtrace/testcase/ \
553 archive/dtrace/testcase/$(KBUILD_TARGET_ARCH) \
554 archive/dtrace/scripts,) \
555 ,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
556
557
558#
559# .tar.bz2 for with the debug info.
560#
561$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
562 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, \
563 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
564 $(call MSG_L1,Packing $@)
565 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
566ifdef VBOX_USE_PBZIP2
567 $(QUIET)tar --dereference --owner 0 --group 0 \
568 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
569 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
570 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
571else
572 $(QUIET)tar --dereference --owner 0 --group 0 \
573 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
574 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
575endif
576
577# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
578$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
579 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
580 $(call MSG_TOOL,copydbg,$<,$@)
581 $(QUIET)objcopy --only-keep-debug $< $@
582
583# rules for creating directories in archive-dbg (the pattern rules depends on these).
584BLDDIRS += $(foreach d, \
585 $(VBOX_LNX_DBG_PATH) \
586 $(VBOX_LNX_DBG_PATH)/components \
587 ,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
588
589include $(FILE_KBUILD_SUB_FOOTER)
590
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