VirtualBox

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

Last change on this file since 74100 was 72322, checked in by vboxsync, 7 years ago

Installer/Linux: bugref:9049: Simplifying code committed in r122755 to get rid of sed hack.

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