VirtualBox

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

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

Linux installer: fixed path /opt/VirtualBox for the .run installer

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.1 KB
Line 
1# $Id: Makefile.kmk 16262 2009-01-27 12:46:59Z 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 deffiles \
52 routines.sh \
53 vboxdrv.sh \
54 VirtualBox.tar.bz2 \
55 LICENSE) \
56 $(wildcard $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-*) \
57 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/,\
58 vboxdrv.sh \
59 install.sh)
60
61#
62# Linux installs.
63#
64INSTALLS += linux-bin
65linux-bin_INST = bin/
66linux-bin_MODE = a+rx,u+w
67linux-bin_SOURCES = \
68 VBoxSysInfo.sh \
69 VBox.sh=>VBox.sh
70
71INSTALLS += linux-misc
72linux-misc_INST = bin/
73linux-misc_MODE = a+r,u+w
74linux-misc_SOURCES = \
75 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
76 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
77 $(if $(VBOX_WITH_QTGUI),$(PATH_linux-misc)/VirtualBox.desktop,)
78linux-misc_CLEAN = $(PATH_linux-misc)/VirtualBox.desktop
79
80$$(PATH_linux-misc)/VirtualBox.desktop: $(PATH_SUB_CURRENT)/VirtualBox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
81 $(call MSG_GENERATE,,$@,$<)
82ifdef VBOX_PATH_PACKAGE_DOCS
83 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
84else
85 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox+" --output $@ $<
86endif
87
88
89
90#
91# The files residing in bin/ that we'll ship.
92#
93
94# Strip these binaries
95VBOX_LNX_STRIP_BIN = \
96 VBoxDD.so \
97 VBoxDD2.so \
98 VBoxManage \
99 VBoxREM.so \
100 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
101 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
102 VBoxRT.so \
103 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
104 VBoxSettings.so \
105 VBoxSharedClipboard.so \
106 VBoxSharedFolders.so \
107 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so) \
108 VBoxSVC \
109 VBoxDDU.so \
110 VBoxVMM.so \
111 VBoxXPCOM.so \
112 VBoxXPCOMIPCD \
113 $(if $(VBOX_WITH_CROGL),\
114 VBoxOGLhostcrutil.so \
115 VBoxOGLhosterrorspu.so \
116 VBoxOGLrenderspu.so \
117 VBoxSharedCrOpenGL.so) \
118 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
119 VBoxTunctl \
120 components/VBoxC.so \
121 components/VBoxSVCM.so \
122 components/VBoxXPCOMIPCC.so
123
124# Do not remove relocation information of these binaries
125VBOX_LNX_STRIP_OBJ = \
126 VBoxDD2GC.gc \
127 VBoxDD2R0.r0 \
128 VBoxDDGC.gc \
129 VBoxDDR0.r0 \
130 VMMGC.gc \
131 VMMR0.r0
132ifeq ($(KBUILD_TARGET_ARCH),amd64)
133 ifndef VBOX_WITH_NEW_RECOMPILER
134 VBOX_LNX_STRIP_OBJ += \
135 VBoxREM2.rel
136 endif
137endif
138
139# Do not strip anything of these files
140VBOX_LNX_NO_STRIP = \
141 $(if $(VBOX_OSE),,LICENSE) \
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)/libVBox*)),) \
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
172# Documentation
173ifdef VBOX_WITH_DOCS_PACKING
174 VBOX_LNX_NO_STRIP += \
175 VirtualBox.chm UserManual.pdf \
176 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
177 VBOX_LNX_STRIP_BIN += \
178 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
179endif
180
181# VRDP
182ifdef VBOX_WITH_VRDP
183 VBOX_LNX_STRIP_BIN += \
184 VBoxVRDP.so \
185 VRDPAuth.so
186 VBOX_LNX_NO_STRIP += \
187 rdesktop-vrdp.tar.gz
188 ifdef VBOX_WITH_VRDP_RDESKTOP
189 VBOX_LNX_NO_STRIP += \
190 rdesktop-vrdp-keymaps
191 VBOX_LNX_STRIP_BIN += \
192 rdesktop-vrdp
193 endif
194endif
195
196# Headless
197ifdef VBOX_WITH_HEADLESS
198 VBOX_LNX_STRIP_BIN += \
199 VBoxHeadless \
200 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
201endif
202
203# Webservices
204ifdef VBOX_WITH_WEBSERVICES
205 VBOX_LNX_STRIP_BIN += \
206 vboxwebsrv \
207 webtest
208endif
209
210#
211# All the bin files that goes into the archives.
212#
213VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
214
215# Cleanup of the files we copy/symlink from bin.
216OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
217 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
218
219
220#
221# The generic installer.
222#
223$(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
224 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
225 $(VBOX_VERSION_STAMP) \
226 $(VBOX_PATH_LNX_INST_SRC)/routines.sh \
227 $(VBOX_PATH_LNX_INST_SRC)/deffiles \
228 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
229 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
230 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
231 $(wildcard $(PATH_BIN)/src/*) \
232 $(wildcard $(PATH_BIN)/src/*/*) \
233 $(wildcard $(PATH_BIN)/src/*/*/*) \
234 $(wildcard $(PATH_BIN)/src/*/*/*/*)
235 $(call MSG_TOOL,makeself,,$@)
236 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
237 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
238 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/deffiles $(VBOX_LNX_INST_STAGE_DIR)/
239 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
240 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
241 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
242 $(QUIET)$(RM) -f $@
243 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
244 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
245
246# files that needs editing before they can be included in the generic installer.
247$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
248 $(QUIET)$(SED_EXT) \
249 -e "s|%NOLSB%|yes|g" \
250 -e "s|%PACKAGE%|virtualbox|g" \
251 --output $@ \
252 $<
253
254$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh | $$(dir $$@)
255 $(QUIET)$(SED) \
256 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
257 -e "s;_BUILD_;$(date-utc );g" \
258 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
259 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
260 --output $@ \
261 $<
262
263#
264# .tar.bz2 for converting into .run
265#
266$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
267 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
268 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
269 $(VBOX_VERSION_STAMP)
270 $(call MSG_L1,Packing $@)
271 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
272 $(QUIET)$(MKDIR) -p $(@D)
273ifdef VBOX_USE_PBZIP2
274 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
275 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
276else
277 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
278endif
279 $(QUIET)$(CHMOD) 0644 $@
280
281#
282# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
283#
284$(PATH_BIN)/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 -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
290 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
291ifdef VBOX_USE_PBZIP2
292 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
293 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
294 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
295else
296 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
297 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
298endif
299 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
300
301
302# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
303$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
304 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
305 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
306 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
307 | $$(dir $$@)
308 $(call MSG_INST_FILE,$<,$@)
309 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
310 $(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),$@) $@)
311
312# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
313$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
314 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
315 $(call MSG_INST_FILE,$<,$@)
316ifeq ($(VBOX_DO_STRIP),)
317 $(QUIET)$(INSTALL) -m 0644 $< $@
318else # strip to temp file because of umask.
319 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
320 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
321 $(QUIET)$(RM) -f -- [email protected]
322endif
323
324# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
325$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
326 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
327 $(call MSG_INST_SYM,$<,$@)
328 $(QUIET)$(RM) -f $@
329 $(QUIET)$(LN_SYMLINK) $< $@
330
331# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
332BLDDIRS += $(foreach d,\
333 archive \
334 archive/components \
335 archive/nls \
336 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
337 archive/additions \
338 install\
339,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
340
341
342#
343# .tar.bz2 for with the debug info.
344#
345$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
346 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
347 $(call MSG_L1,Packing $@)
348 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
349ifdef VBOX_USE_PBZIP2
350 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
351 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
352 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
353else
354 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
355 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
356endif
357
358# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
359$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
360 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
361 $(call MSG_TOOL,copydbg,$<,$@)
362 $(QUIET)objcopy --only-keep-debug $< $@
363
364# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
365BLDDIRS += $(foreach d,\
366 $(VBOX_LNX_DBG_PATH) \
367 $(VBOX_LNX_DBG_PATH)/components \
368,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
369
370include $(KBUILD_PATH)/subfooter.kmk
371
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