VirtualBox

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

Last change on this file since 20230 was 20230, checked in by vboxsync, 16 years ago

Linux installer: print revision as well

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.1 KB
Line 
1# $Id: Makefile.kmk 20230 2009-06-03 13:07:44Z 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;_SVNREV_;$(VBOX_SVN_REV);g" \
276 -e "s;_BUILD_;$(date-utc );g" \
277 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
278 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
279 --output $@ \
280 $<
281
282#
283# .tar.bz2 for converting into .run
284#
285$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
286 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
287 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
288 $(VBOX_VERSION_STAMP)
289 $(call MSG_L1,Packing $@)
290 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
291 $(QUIET)$(MKDIR) -p $(@D)
292ifdef VBOX_USE_PBZIP2
293 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
294 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
295else
296 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
297endif
298 $(QUIET)$(CHMOD) 0644 $@
299
300#
301# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
302#
303$(PATH_BIN)/VirtualBox.tar.bz2: \
304 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
305 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
306 $(VBOX_VERSION_STAMP)
307 $(call MSG_L1,Packing $@)
308 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
309 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
310ifdef VBOX_USE_PBZIP2
311 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
312 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
313 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
314else
315 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
316 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
317endif
318 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
319
320
321# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
322$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
323 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
324 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
325 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
326 | $$(dir $$@)
327 $(call MSG_INST_FILE,$<,$@)
328 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
329 $(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),$@) $@)
330
331# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
332$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
333 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
334 $(call MSG_INST_FILE,$<,$@)
335ifeq ($(VBOX_DO_STRIP),)
336 $(QUIET)$(INSTALL) -m 0644 $< $@
337else # strip to temp file because of umask.
338 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
339 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
340 $(QUIET)$(RM) -f -- [email protected]
341endif
342
343# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
344$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
345 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
346 $(call MSG_INST_SYM,$<,$@)
347 $(QUIET)$(RM) -f $@
348 $(QUIET)$(LN_SYMLINK) $< $@
349
350# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
351BLDDIRS += $(foreach d,\
352 archive \
353 archive/components \
354 archive/nls \
355 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
356 $(if $(VBOX_WITH_PYTHON),archive/sdk/installer,) \
357 $(if $(VBOX_WITH_PYTHON),archive/sdk/installer/vboxapi,) \
358 $(if $(VBOX_WITH_PYTHON),archive/sdk/bindings/xpcom/python/xpcom,) \
359 $(if $(VBOX_WITH_PYTHON),archive/sdk/bindings/xpcom/python/xpcom/client,) \
360 archive/additions \
361 install\
362,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
363
364
365#
366# .tar.bz2 for with the debug info.
367#
368$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
369 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
370 $(call MSG_L1,Packing $@)
371 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
372ifdef VBOX_USE_PBZIP2
373 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
374 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
375 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
376else
377 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
378 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
379endif
380
381# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
382$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
383 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
384 $(call MSG_TOOL,copydbg,$<,$@)
385 $(QUIET)objcopy --only-keep-debug $< $@
386
387# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
388BLDDIRS += $(foreach d,\
389 $(VBOX_LNX_DBG_PATH) \
390 $(VBOX_LNX_DBG_PATH)/components \
391,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
392
393include $(KBUILD_PATH)/subfooter.kmk
394
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