VirtualBox

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

Last change on this file since 40264 was 39358, checked in by vboxsync, 13 years ago

Installers/linux: make do_dkms take arguments instead of requiring patching.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.2 KB
Line 
1# $Id: Makefile.kmk 39358 2011-11-17 22:25:36Z 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 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
342 --output $@ \
343 $<
344
345$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
346 $(QUIET)$(SED_EXT) \
347 -e "s|%NOLSB%|yes|g" \
348 -e "s|%DEBIAN%||g" \
349 -e "s|%PACKAGE%|virtualbox|g" \
350 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \
351 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \
352 --output $@ \
353 $<
354
355$(VBOX_LNX_INST_OUT_DIR)/vboxweb-service.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxweb-service.sh.in | $$(dir $$@)
356 $(QUIET)$(SED_EXT) \
357 -e "s|%NOLSB%|yes|g" \
358 -e "s|%DEBIAN%||g" \
359 -e "s|%PACKAGE%|virtualbox|g" \
360 --output $@ \
361 $<
362
363$(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 $$@)
364 $(QUIET)$(SED) \
365 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
366 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
367 -e "s;_BUILD_;$(date-utc );g" \
368 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
369 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
370 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
371 -e "s;_USERNAME_;$(USERNAME);g" \
372 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
373 -e '/#include installer-common.sh/ {' \
374 -e "r $(PATH_ROOT)/src/VBox/Installer/linux/installer-common.sh" \
375 -e 'd' \
376 -e '}' \
377 --output $@ \
378 $<
379
380#
381# The files that the tar archives depend on. The wildcards are ugly, but they
382# do save us from having to update the makefile whenever something new is added
383# to the module source directories.
384#
385VBOX_LNX_INST_ARCH_DEPS := \
386 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
387 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
388 $(VBOX_VERSION_STAMP) \
389 $(wildcard $(PATH_STAGE_BIN)/src/*) \
390 $(wildcard $(PATH_STAGE_BIN)/src/*/*) \
391 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*) \
392 $(wildcard $(PATH_STAGE_BIN)/src/*/*/*/*)
393
394
395#
396# .tar.bz2 for converting into .run
397#
398$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
399 $(call MSG_L1,Packing $@)
400 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
401 $(QUIET)$(MKDIR) -p $(@D)
402ifdef VBOX_USE_PBZIP2
403 $(QUIET)tar --dereference --owner 0 --group 0 \
404 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
405 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
406else
407 $(QUIET)tar --dereference --owner 0 --group 0 \
408 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
409endif
410 $(QUIET)$(CHMOD) 0644 $@
411
412#
413# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
414#
415$(PATH_STAGE_BIN)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
416 $(call MSG_L1,Packing $@)
417 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
418 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
419ifdef VBOX_USE_PBZIP2
420 $(QUIET)tar --dereference --owner 0 --group 0 \
421 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
422 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
423 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
424else
425 $(QUIET)tar --dereference --owner 0 --group 0 \
426 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
427 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
428endif
429 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
430
431
432# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
433$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
434 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
435 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
436 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
437 | $$(dir $$@)
438 $(call MSG_INST_FILE,$<,$@)
439 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
440 $(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),$@) $@)
441
442# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
443$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
444 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
445 $(call MSG_INST_FILE,$<,$@)
446ifeq ($(VBOX_DO_STRIP),)
447 $(QUIET)$(INSTALL) -m 0644 $< $@
448else # strip to temp file because of umask.
449 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
450 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
451 $(QUIET)$(RM) -f -- [email protected]
452endif
453
454# special rule for the kernel modules
455$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
456 $(call MSG_INST_SYM,$<,$@)
457 $(QUIET)$(RM) -Rf $@
458 $(QUIET)$(MKDIR) $@
459 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
460
461# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
462$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
463 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
464 $(call MSG_INST_SYM,$<,$@)
465 $(QUIET)$(RM) -f $@
466 $(QUIET)$(LN_SYMLINK) $< $@
467
468# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
469BLDDIRS += $(foreach d,\
470 archive \
471 archive/components \
472 archive/nls \
473 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
474 $(if $(VBOX_WITH_PYTHON),\
475 archive/sdk/installer \
476 archive/sdk/installer/vboxapi \
477 archive/sdk/bindings/xpcom/python/xpcom \
478 archive/sdk/bindings/xpcom/python/xpcom/client \
479 archive/sdk/bindings/xpcom/python/xpcom/server,) \
480 $(if $(VBOX_WITH_JXPCOM),\
481 archive/sdk/bindings/xpcom/java,) \
482 archive/additions \
483 install\
484,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
485
486
487#
488# .tar.bz2 for with the debug info.
489#
490$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
491 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
492 $(call MSG_L1,Packing $@)
493 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
494ifdef VBOX_USE_PBZIP2
495 $(QUIET)tar --dereference --owner 0 --group 0 \
496 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
497 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
498 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
499else
500 $(QUIET)tar --dereference --owner 0 --group 0 \
501 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
502 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
503endif
504
505# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
506$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
507 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
508 $(call MSG_TOOL,copydbg,$<,$@)
509 $(QUIET)objcopy --only-keep-debug $< $@
510
511# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
512BLDDIRS += $(foreach d,\
513 $(VBOX_LNX_DBG_PATH) \
514 $(VBOX_LNX_DBG_PATH)/components \
515,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
516
517include $(KBUILD_PATH)/subfooter.kmk
518
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