VirtualBox

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

Last change on this file since 80508 was 80360, checked in by vboxsync, 5 years ago

HostServices/SharedOpenGL: Remove most of the chromium related HGCM service bits leaving only the renderspu and OpenGLTest app for now as they are used for VMSVGA as well (OpenGLTest needs to be rewritten), bugref:9529

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