VirtualBox

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

Last change on this file since 47894 was 47894, checked in by vboxsync, 11 years ago

VBoxNetLwipNAT => VBoxNetNAT

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