VirtualBox

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

Last change on this file since 20149 was 20149, checked in by vboxsync, 15 years ago

Python: ship and install bindings with binary install on Linux

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.1 KB
Line 
1# $Id: Makefile.kmk 20149 2009-05-29 12:30:26Z vboxsync $
2## @file
3# Makefile for the Linux installer.
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18# Clara, CA 95054 USA or visit http://www.sun.com if you need
19# additional information or have any questions.
20#
21
22SUB_DEPTH = ../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25ifneq ($(KBUILD_HOST),linux)
26 $(error "The Linux installer can only be built on Linux!")
27endif
28
29#
30# Globals and targets.
31#
32VBOX_PATH_LNX_INST_SRC := $(PATH_SUB_CURRENT)
33VBOX_LNX_INST_OUT_DIR := $(PATH_TARGET)/Installer/linux
34VBOX_LNX_INST_STAGE_DIR := $(PATH_TARGET)/Installer/linux/install
35VBOX_LNX_DBG_PATH := usr/lib/debug/opt/VirtualBox
36VBOX_LNX_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
37
38# Unset this to speed up things during makefile hacking.
39VBOX_LNX_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
40
41BLDDIRS += $(VBOX_LNX_INST_OUT_DIR) $(VBOX_LNX_INST_STAGE_DIR)
42PACKING += $(PATH_BIN)/VirtualBox.tar.bz2
43if !defined(VBOX_NO_LINUX_RUN_INSTALLER) && !defined(VBOX_OSE)
44 PACKING += $(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME) \
45 $(PATH_BIN)/VirtualBox-dbg.tar.bz2
46endif
47
48OTHER_CLEAN += \
49 $(addprefix $(VBOX_LNX_INST_STAGE_DIR)/,\
50 install.sh \
51 uninstall.sh \
52 deffiles \
53 routines.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 VBoxSysInfo.sh \
70 VBox.sh=>VBox.sh
71
72INSTALLS += linux-misc
73linux-misc_INST = bin/
74linux-misc_MODE = a+r,u+w
75linux-misc_SOURCES = \
76 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
77 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
78 $(if $(VBOX_WITH_QTGUI),$(PATH_linux-misc)/VirtualBox.desktop,)
79linux-misc_CLEAN = $(PATH_linux-misc)/VirtualBox.desktop
80
81$$(PATH_linux-misc)/VirtualBox.desktop: $(PATH_SUB_CURRENT)/VirtualBox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
82 $(call MSG_GENERATE,,$@,$<)
83ifdef VBOX_PATH_PACKAGE_DOCS
84 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
85else
86 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox+" --output $@ $<
87endif
88
89
90
91#
92# The files residing in bin/ that we'll ship.
93#
94
95# Strip these binaries
96VBOX_LNX_STRIP_BIN = \
97 VBoxDD.so \
98 VBoxDD2.so \
99 VBoxREM.so \
100 VBoxDDU.so \
101 VBoxVMM.so \
102 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
103 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
104 VBoxRT.so \
105 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
106 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
107 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
108 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
109 $(if $(VBOX_WITH_MAIN), \
110 VBoxManage \
111 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
112 VBoxNetAdpCtl \
113 VBoxSVC \
114 VBoxSettings.so \
115 VBoxXPCOM.so \
116 VBoxXPCOMC.so \
117 VBoxXPCOMIPCD \
118 components/VBoxXPCOMIPCC.so \
119 components/VBoxSVCM.so \
120 components/VBoxC.so,) \
121 $(if $(VBOX_WITH_CROGL),\
122 VBoxOGLhostcrutil.so \
123 VBoxOGLhosterrorspu.so \
124 VBoxOGLrenderspu.so \
125 VBoxSharedCrOpenGL.so,) \
126 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
127 VBoxTunctl
128
129# Do not remove relocation information of these binaries
130VBOX_LNX_STRIP_OBJ = \
131 VBoxDD2GC.gc \
132 VBoxDD2R0.r0 \
133 VBoxDDGC.gc \
134 VBoxDDR0.r0 \
135 VMMGC.gc \
136 VMMR0.r0
137
138# Do not strip anything of these files
139VBOX_LNX_NO_STRIP = \
140 $(if $(VBOX_OSE),,LICENSE) \
141 $(if $(VBOX_WITH_MAIN), \
142 components/VBoxXPCOMBase.xpt \
143 components/VirtualBox_XPCOM.xpt) \
144 VBoxSysInfo.sh \
145 VBox.sh \
146 VBox.png \
147 src
148
149# Qt4 GUI
150ifdef VBOX_WITH_QTGUI
151 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
152 VBOX_LNX_STRIP_BIN += \
153 VBoxKeyboard.so \
154 VirtualBox \
155 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
156 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
157 VBOX_LNX_NO_STRIP += \
158 VirtualBox.desktop \
159 $(VBOX_LICENSE_FILES) \
160 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_BIN)/lib*VBox*)),) \
161 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
162 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
163endif
164
165# Guest Additions
166ifdef VBOX_WITH_ADDITIONS_PACKING
167 VBOX_LNX_NO_STRIP += \
168 additions/VBoxGuestAdditions.iso
169endif
170
171# Documentation
172ifdef VBOX_WITH_DOCS_PACKING
173 VBOX_LNX_NO_STRIP += \
174 VirtualBox.chm UserManual.pdf \
175 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
176 VBOX_LNX_STRIP_BIN += \
177 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
178endif
179
180# VRDP
181ifdef VBOX_WITH_VRDP
182 VBOX_LNX_STRIP_BIN += \
183 VBoxVRDP.so \
184 VRDPAuth.so
185 VBOX_LNX_NO_STRIP += \
186 rdesktop-vrdp.tar.gz
187 ifdef VBOX_WITH_VRDP_RDESKTOP
188 VBOX_LNX_NO_STRIP += \
189 rdesktop-vrdp-keymaps
190 VBOX_LNX_STRIP_BIN += \
191 rdesktop-vrdp
192 endif
193endif
194
195# Python XPCOM glue
196ifdef VBOX_WITH_PYTHON
197 VBOX_LNX_NO_STRIP += \
198 $(foreach f,$(notdir $(wildcard $(PATH_BIN)/sdk/bindings/xpcom/python/xpcom/*.py)),sdk/bindings/xpcom/python/xpcom/$(f)) \
199 sdk/bindings/xpcom/python/xpcom/client/__init__.py \
200 sdk/installer/vboxapisetup.py \
201 sdk/installer/vboxapi/__init__.py \
202 sdk/installer/vboxapi/VirtualBox_constants.py
203endif
204
205# Headless
206ifdef VBOX_WITH_HEADLESS
207 VBOX_LNX_STRIP_BIN += \
208 VBoxHeadless \
209 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
210endif
211
212# BFE
213ifdef VBOX_WITH_BFE
214 VBOX_LNX_STRIP_BIN += \
215 VBoxBFE \
216 $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
217endif
218
219# Webservices
220ifdef VBOX_WITH_WEBSERVICES
221 VBOX_LNX_STRIP_BIN += \
222 vboxwebsrv \
223 webtest
224endif
225
226#
227# All the bin files that goes into the archives.
228#
229VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
230
231# Cleanup of the files we copy/symlink from bin.
232OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
233 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
234
235
236#
237# The generic installer.
238#
239$(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
240 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
241 $(VBOX_VERSION_STAMP) \
242 $(VBOX_PATH_LNX_INST_SRC)/routines.sh \
243 $(VBOX_PATH_LNX_INST_SRC)/deffiles \
244 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
245 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
246 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
247 $(VBOX_PATH_LNX_INST_SRC)/uninstall.sh \
248 $(wildcard $(PATH_BIN)/src/*) \
249 $(wildcard $(PATH_BIN)/src/*/*) \
250 $(wildcard $(PATH_BIN)/src/*/*/*) \
251 $(wildcard $(PATH_BIN)/src/*/*/*/*)
252 $(call MSG_TOOL,makeself,,$@)
253 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
254 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
255 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/deffiles $(VBOX_LNX_INST_STAGE_DIR)/
256 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
257 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
258 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
259 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/uninstall.sh $(VBOX_LNX_INST_STAGE_DIR)/
260 $(QUIET)$(RM) -f $@
261 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
262 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
263
264# files that needs editing before they can be included in the generic installer.
265$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
266 $(QUIET)$(SED_EXT) \
267 -e "s|%NOLSB%|yes|g" \
268 -e "s|%PACKAGE%|virtualbox|g" \
269 --output $@ \
270 $<
271
272$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) | $$(dir $$@)
273 $(QUIET)$(SED) \
274 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
275 -e "s;_BUILD_;$(date-utc );g" \
276 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
277 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
278 --output $@ \
279 $<
280
281#
282# .tar.bz2 for converting into .run
283#
284$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
285 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
286 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
287 $(VBOX_VERSION_STAMP)
288 $(call MSG_L1,Packing $@)
289 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
290 $(QUIET)$(MKDIR) -p $(@D)
291ifdef VBOX_USE_PBZIP2
292 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
293 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
294else
295 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
296endif
297 $(QUIET)$(CHMOD) 0644 $@
298
299#
300# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
301#
302$(PATH_BIN)/VirtualBox.tar.bz2: \
303 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
304 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
305 $(VBOX_VERSION_STAMP)
306 $(call MSG_L1,Packing $@)
307 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
308 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
309ifdef VBOX_USE_PBZIP2
310 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
311 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
312 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
313else
314 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
315 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
316endif
317 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
318
319
320# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
321$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
322 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
323 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
324 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
325 | $$(dir $$@)
326 $(call MSG_INST_FILE,$<,$@)
327 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
328 $(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),$@) $@)
329
330# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
331$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
332 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
333 $(call MSG_INST_FILE,$<,$@)
334ifeq ($(VBOX_DO_STRIP),)
335 $(QUIET)$(INSTALL) -m 0644 $< $@
336else # strip to temp file because of umask.
337 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
338 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
339 $(QUIET)$(RM) -f -- $@.tmp
340endif
341
342# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
343$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
344 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
345 $(call MSG_INST_SYM,$<,$@)
346 $(QUIET)$(RM) -f $@
347 $(QUIET)$(LN_SYMLINK) $< $@
348
349# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
350BLDDIRS += $(foreach d,\
351 archive \
352 archive/components \
353 archive/nls \
354 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
355 $(if $(VBOX_WITH_PYTHON),archive/sdk/installer,) \
356 $(if $(VBOX_WITH_PYTHON),archive/sdk/installer/vboxapi,) \
357 $(if $(VBOX_WITH_PYTHON),archive/sdk/bindings/xpcom/python/xpcom,) \
358 $(if $(VBOX_WITH_PYTHON),archive/sdk/bindings/xpcom/python/xpcom/client,) \
359 archive/additions \
360 install\
361,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
362
363
364#
365# .tar.bz2 for with the debug info.
366#
367$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
368 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
369 $(call MSG_L1,Packing $@)
370 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
371ifdef VBOX_USE_PBZIP2
372 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
373 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
374 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
375else
376 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
377 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
378endif
379
380# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
381$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
382 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
383 $(call MSG_TOOL,copydbg,$<,$@)
384 $(QUIET)objcopy --only-keep-debug $< $@
385
386# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
387BLDDIRS += $(foreach d,\
388 $(VBOX_LNX_DBG_PATH) \
389 $(VBOX_LNX_DBG_PATH)/components \
390,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
391
392include $(KBUILD_PATH)/subfooter.kmk
393
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