VirtualBox

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

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

rdesktop-vrdp: Drop as it is too old and practically abandoned, bugref:10245

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