VirtualBox

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

Last change on this file since 86199 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

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