VirtualBox

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

Last change on this file since 39323 was 39223, checked in by vboxsync, 13 years ago

Installer/linux: nomenclature.

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