VirtualBox

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

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

Installer: Removed VBOX_WITH_REM preprocessor stuff. bugref:9576

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.7 KB
Line 
1# $Id: Makefile.kmk 81159 2019-10-08 15:04:14Z 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 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# EFI firmware
335ifdef VBOX_WITH_EFIFW_PACKING
336 VBOX_LNX_NO_STRIP += \
337 VBoxEFI32.fd \
338 VBoxEFI64.fd
339endif
340
341# DTrace library and scripts.
342ifdef VBOX_WITH_DTRACE
343 VBOX_LNX_NO_STRIP += \
344 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
345 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
346 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
347endif
348
349# Icons
350VBOX_MIME_ICONS = \
351 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/other/,\
352 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
353 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
354 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
355
356VBOX_DESKTOP_ICONS = \
357 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/$(if $(VBOX_OSE),OSE,NonOSE)/,\
358 $(foreach s,16 20 32 40 48 64 128,\
359 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
360 virtualbox.svg=>scalable/virtualbox.svg)
361
362#
363# All the bin files that goes into the archives.
364#
365VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
366
367# Cleanup of the files we copy/symlink from bin.
368OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(filter-out src,$(VBOX_LNX_ARCH_FILES)) src/vboxhost) \
369 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
370 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
371
372#
373# The generic installer.
374#
375$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
376 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
377 $(VBOX_VERSION_STAMP) \
378 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
379 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
380 $$(linux-scripts_2_STAGE_TARGETS)
381 $(call MSG_TOOL,makeself,,$@)
382 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
383 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
384 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
385 $(QUIET)$(RM) -f $@
386 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
387 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
388
389$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) $(wildcard $(VBOX_SVN_REV_KMK).ts) | $$(dir $$@)
390 $(QUIET)$(SED) \
391 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
392 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
393 -e "s;_BUILD_;$(date-utc );g" \
394 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
395 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
396 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
397 -e "s;_USERNAME_;$(USERNAME);g" \
398 -e "s;_INSTALLATION_DIR_;$(VBOX_LNX_APP_PRIVATE);g" \
399 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
400 --output $@ \
401 $<
402
403#
404# The files that the tar archives depend on.
405#
406
407include $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/files_vboxdrv
408VBOX_LNX_INST_FILES_VBOXDRV=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxdrv/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXDRV_NOBIN)))))
409include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
410VBOX_LNX_INST_FILES_VBOXNETFLT=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetflt/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)))))
411include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
412VBOX_LNX_INST_FILES_VBOXNETADP=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetadp/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)))))
413include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci
414VBOX_LNX_INST_FILES_VBOXPCI=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxpci/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXPCI_SOURCES)))))
415
416VBOX_LNX_INST_ARCH_DEPS := \
417 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
418 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
419 $(VBOX_VERSION_STAMP) \
420 $(VBOX_LNX_INST_FILES_VBOXDRV) \
421 $(VBOX_LNX_INST_FILES_VBOXNETFLT) \
422 $(VBOX_LNX_INST_FILES_VBOXNETADP) \
423 $(VBOX_LNX_INST_FILES_VBOXPCI)
424
425#
426# .tar.bz2 for converting into .run
427#
428$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
429 $(call MSG_L1,Packing $@)
430 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
431 $(QUIET)$(MKDIR) -p $(@D)
432ifdef VBOX_USE_PBZIP2
433 $(QUIET)tar --dereference --owner 0 --group 0 \
434 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
435 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
436else
437 $(QUIET)tar --dereference --owner 0 --group 0 \
438 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
439endif
440 $(QUIET)$(CHMOD) 0644 $@
441
442#
443# .tar for distribution with the files under VirtualBox-<ver>/.
444#
445$(PATH_STAGE_BIN)/VirtualBox.tar: $(VBOX_LNX_INST_ARCH_DEPS)
446 $(call MSG_L1,Packing $@)
447 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
448 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
449 $(QUIET)tar --dereference --owner 0 --group 0 \
450 -cRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
451 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
452 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
453
454
455# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
456$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
457 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
458 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
459 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
460 | $$(dir $$@)
461 $(call MSG_INST_FILE,$<,$@)
462 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
463 $(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),$@) $@)
464
465# pattern rule for copying VBOX_LNX_DBG_BIN files to archive-dbg/
466$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_DBG_BIN)): \
467 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
468 $(call MSG_INST_FILE,$<,$@)
469 $(QUIET)$(CP) $< $@
470
471# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
472$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
473 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
474 $(call MSG_INST_FILE,$<,$@)
475ifeq ($(VBOX_DO_STRIP),)
476 $(QUIET)$(INSTALL) -m 0644 $< $@
477else # strip to temp file because of umask.
478 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
479 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
480 $(QUIET)$(RM) -f -- $@.tmp
481endif
482
483# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
484$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
485 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
486 $(call MSG_INST_SYM,$<,$@)
487 $(QUIET)$(RM) -f $@
488 $(QUIET)$(LN_SYMLINK) $< $@
489
490# special rule for the kernel modules
491$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
492 $(call MSG_INST_SYM,$<,$@)
493 $(QUIET)$(RM) -Rf $@
494 $(QUIET)$(MKDIR) $@
495 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
496
497# rules for creating directories in archive (the pattern rules depends on these).
498BLDDIRS += $(foreach d,\
499 archive \
500 archive/components \
501 archive/nls \
502 $(if $(VBOX_WITH_UNATTENDED),archive/unattended_templates,) \
503 $(if $(VBOX_WITH_ORACLE_QT), \
504 archive/plugins/platforms \
505 archive/plugins/xcbglintegrations \
506 archive/legacy,) \
507 $(if $(VBOX_WITH_PYTHON),\
508 archive/sdk/installer \
509 archive/sdk/installer/vboxapi \
510 archive/sdk/bindings/xpcom/python/xpcom \
511 archive/sdk/bindings/xpcom/python/xpcom/client \
512 archive/sdk/bindings/xpcom/python/xpcom/server,) \
513 $(if $(VBOX_WITH_JXPCOM),\
514 archive/sdk/bindings/xpcom/java,) \
515 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
516 archive/ExtensionPacks/VNC \
517 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
518 archive/additions \
519 $(if-expr defined(VBOX_UNATTENDED_TEMPLATES),archive/UnattendedTemplates,) \
520 install \
521 $(if $(VBOX_WITH_DTRACE),\
522 archive/dtrace \
523 archive/dtrace/lib \
524 archive/dtrace/lib/$(KBUILD_TARGET_ARCH) \
525 archive/dtrace/testcase/ \
526 archive/dtrace/testcase/$(KBUILD_TARGET_ARCH) \
527 archive/dtrace/scripts,) \
528,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
529
530
531#
532# .tar.bz2 for with the debug info.
533#
534$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
535 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
536 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
537 $(call MSG_L1,Packing $@)
538 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
539ifdef VBOX_USE_PBZIP2
540 $(QUIET)tar --dereference --owner 0 --group 0 \
541 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
542 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
543 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
544else
545 $(QUIET)tar --dereference --owner 0 --group 0 \
546 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
547 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
548endif
549
550# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
551$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
552 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
553 $(call MSG_TOOL,copydbg,$<,$@)
554 $(QUIET)objcopy --only-keep-debug $< $@
555
556# rules for creating directories in archive-dbg (the pattern rules depends on these).
557BLDDIRS += $(foreach d,\
558 $(VBOX_LNX_DBG_PATH) \
559 $(VBOX_LNX_DBG_PATH)/components \
560,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
561
562include $(FILE_KBUILD_SUB_FOOTER)
563
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