VirtualBox

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

Last change on this file since 104853 was 104738, checked in by vboxsync, 7 months ago

Installer/linux: Allow creating a run package, bugref:10391 [scm]

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