VirtualBox

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

Last change on this file since 103131 was 103043, checked in by vboxsync, 9 months ago

Main/Python: Linux installer fixes. bugref:10579

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