VirtualBox

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

Last change on this file since 57984 was 57812, checked in by vboxsync, 9 years ago

Installer/linux: rework service handling in RPM to use shared scripts and add systemd support.

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