VirtualBox

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

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

Ship VBoxXPCOMC.so on linux

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.1 KB
Line 
1# $Id: Makefile.kmk 17571 2009-03-09 12:40:58Z 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 VBoxXPCOMC.so \
113 VBoxXPCOMIPCD \
114 $(if $(VBOX_WITH_CROGL),\
115 VBoxOGLhostcrutil.so \
116 VBoxOGLhosterrorspu.so \
117 VBoxOGLrenderspu.so \
118 VBoxSharedCrOpenGL.so) \
119 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
120 VBoxTunctl \
121 components/VBoxC.so \
122 components/VBoxSVCM.so \
123 components/VBoxXPCOMIPCC.so
124
125# Do not remove relocation information of these binaries
126VBOX_LNX_STRIP_OBJ = \
127 VBoxDD2GC.gc \
128 VBoxDD2R0.r0 \
129 VBoxDDGC.gc \
130 VBoxDDR0.r0 \
131 VMMGC.gc \
132 VMMR0.r0
133ifeq ($(KBUILD_TARGET_ARCH),amd64)
134 ifndef VBOX_WITH_NEW_RECOMPILER
135 VBOX_LNX_STRIP_OBJ += \
136 VBoxREM2.rel
137 endif
138endif
139
140# Do not strip anything of these files
141VBOX_LNX_NO_STRIP = \
142 $(if $(VBOX_OSE),,LICENSE) \
143 components/VBoxXPCOMBase.xpt \
144 components/VirtualBox_XPCOM.xpt \
145 VBoxSysInfo.sh \
146 VBox.sh \
147 VBox.png \
148 src
149
150# Qt4 GUI
151ifdef VBOX_WITH_QTGUI
152 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
153 VBOX_LNX_STRIP_BIN += \
154 VBoxKeyboard.so \
155 VirtualBox \
156 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
157 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
158 VBOX_LNX_NO_STRIP += \
159 VirtualBox.desktop \
160 $(VBOX_LICENSE_FILES) \
161 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_BIN)/lib*VBox*)),) \
162 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
163 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
164endif
165
166# Guest Additions
167ifdef VBOX_WITH_ADDITIONS_PACKING
168 VBOX_LNX_NO_STRIP += \
169 additions/VBoxGuestAdditions.iso
170endif
171
172
173# Documentation
174ifdef VBOX_WITH_DOCS_PACKING
175 VBOX_LNX_NO_STRIP += \
176 VirtualBox.chm UserManual.pdf \
177 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
178 VBOX_LNX_STRIP_BIN += \
179 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
180endif
181
182# VRDP
183ifdef VBOX_WITH_VRDP
184 VBOX_LNX_STRIP_BIN += \
185 VBoxVRDP.so \
186 VRDPAuth.so
187 VBOX_LNX_NO_STRIP += \
188 rdesktop-vrdp.tar.gz
189 ifdef VBOX_WITH_VRDP_RDESKTOP
190 VBOX_LNX_NO_STRIP += \
191 rdesktop-vrdp-keymaps
192 VBOX_LNX_STRIP_BIN += \
193 rdesktop-vrdp
194 endif
195endif
196
197# Headless
198ifdef VBOX_WITH_HEADLESS
199 VBOX_LNX_STRIP_BIN += \
200 VBoxHeadless \
201 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
202endif
203
204# Webservices
205ifdef VBOX_WITH_WEBSERVICES
206 VBOX_LNX_STRIP_BIN += \
207 vboxwebsrv \
208 webtest
209endif
210
211#
212# All the bin files that goes into the archives.
213#
214VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
215
216# Cleanup of the files we copy/symlink from bin.
217OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
218 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
219
220
221#
222# The generic installer.
223#
224$(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
225 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
226 $(VBOX_VERSION_STAMP) \
227 $(VBOX_PATH_LNX_INST_SRC)/routines.sh \
228 $(VBOX_PATH_LNX_INST_SRC)/deffiles \
229 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
230 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
231 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
232 $(wildcard $(PATH_BIN)/src/*) \
233 $(wildcard $(PATH_BIN)/src/*/*) \
234 $(wildcard $(PATH_BIN)/src/*/*/*) \
235 $(wildcard $(PATH_BIN)/src/*/*/*/*)
236 $(call MSG_TOOL,makeself,,$@)
237 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
238 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
239 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/deffiles $(VBOX_LNX_INST_STAGE_DIR)/
240 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
241 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
242 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
243 $(QUIET)$(RM) -f $@
244 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
245 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
246
247# files that needs editing before they can be included in the generic installer.
248$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
249 $(QUIET)$(SED_EXT) \
250 -e "s|%NOLSB%|yes|g" \
251 -e "s|%PACKAGE%|virtualbox|g" \
252 --output $@ \
253 $<
254
255$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh | $$(dir $$@)
256 $(QUIET)$(SED) \
257 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
258 -e "s;_BUILD_;$(date-utc );g" \
259 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
260 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
261 --output $@ \
262 $<
263
264#
265# .tar.bz2 for converting into .run
266#
267$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
268 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
269 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
270 $(VBOX_VERSION_STAMP)
271 $(call MSG_L1,Packing $@)
272 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
273 $(QUIET)$(MKDIR) -p $(@D)
274ifdef VBOX_USE_PBZIP2
275 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
276 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
277else
278 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
279endif
280 $(QUIET)$(CHMOD) 0644 $@
281
282#
283# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
284#
285$(PATH_BIN)/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 -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
291 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
292ifdef VBOX_USE_PBZIP2
293 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
294 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
295 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
296else
297 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
298 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
299endif
300 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
301
302
303# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
304$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
305 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
306 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
307 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
308 | $$(dir $$@)
309 $(call MSG_INST_FILE,$<,$@)
310 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
311 $(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),$@) $@)
312
313# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
314$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
315 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
316 $(call MSG_INST_FILE,$<,$@)
317ifeq ($(VBOX_DO_STRIP),)
318 $(QUIET)$(INSTALL) -m 0644 $< $@
319else # strip to temp file because of umask.
320 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
321 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
322 $(QUIET)$(RM) -f -- [email protected]
323endif
324
325# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
326$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
327 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
328 $(call MSG_INST_SYM,$<,$@)
329 $(QUIET)$(RM) -f $@
330 $(QUIET)$(LN_SYMLINK) $< $@
331
332# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
333BLDDIRS += $(foreach d,\
334 archive \
335 archive/components \
336 archive/nls \
337 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
338 archive/additions \
339 install\
340,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
341
342
343#
344# .tar.bz2 for with the debug info.
345#
346$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
347 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
348 $(call MSG_L1,Packing $@)
349 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
350ifdef VBOX_USE_PBZIP2
351 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
352 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
353 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
354else
355 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
356 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
357endif
358
359# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
360$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
361 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
362 $(call MSG_TOOL,copydbg,$<,$@)
363 $(QUIET)objcopy --only-keep-debug $< $@
364
365# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
366BLDDIRS += $(foreach d,\
367 $(VBOX_LNX_DBG_PATH) \
368 $(VBOX_LNX_DBG_PATH)/components \
369,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
370
371include $(KBUILD_PATH)/subfooter.kmk
372
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette