VirtualBox

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

Last change on this file since 58458 was 58441, checked in by vboxsync, 9 years ago

#8051: Installers: unify Linux host installers as far as possible: remove a test case which tested a script no longer installed by default and a sub-script of the removed script.

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