VirtualBox

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

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

Renamed src/recompiler_new to src/recompiler.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.5 KB
Line 
1# $Id: Makefile.kmk 19297 2009-05-01 17:03:40Z 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# Headless
196ifdef VBOX_WITH_HEADLESS
197 VBOX_LNX_STRIP_BIN += \
198 VBoxHeadless \
199 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
200endif
201
202# BFE
203ifdef VBOX_WITH_BFE
204 VBOX_LNX_STRIP_BIN += \
205 VBoxBFE \
206 $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
207endif
208
209# Webservices
210ifdef VBOX_WITH_WEBSERVICES
211 VBOX_LNX_STRIP_BIN += \
212 vboxwebsrv \
213 webtest
214endif
215
216#
217# All the bin files that goes into the archives.
218#
219VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
220
221# Cleanup of the files we copy/symlink from bin.
222OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
223 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
224
225
226#
227# The generic installer.
228#
229$(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
230 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
231 $(VBOX_VERSION_STAMP) \
232 $(VBOX_PATH_LNX_INST_SRC)/routines.sh \
233 $(VBOX_PATH_LNX_INST_SRC)/deffiles \
234 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
235 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
236 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
237 $(VBOX_PATH_LNX_INST_SRC)/uninstall.sh \
238 $(wildcard $(PATH_BIN)/src/*) \
239 $(wildcard $(PATH_BIN)/src/*/*) \
240 $(wildcard $(PATH_BIN)/src/*/*/*) \
241 $(wildcard $(PATH_BIN)/src/*/*/*/*)
242 $(call MSG_TOOL,makeself,,$@)
243 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
244 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
245 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/deffiles $(VBOX_LNX_INST_STAGE_DIR)/
246 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
247 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
248 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
249 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/uninstall.sh $(VBOX_LNX_INST_STAGE_DIR)/
250 $(QUIET)$(RM) -f $@
251 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
252 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
253
254# files that needs editing before they can be included in the generic installer.
255$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
256 $(QUIET)$(SED_EXT) \
257 -e "s|%NOLSB%|yes|g" \
258 -e "s|%PACKAGE%|virtualbox|g" \
259 --output $@ \
260 $<
261
262$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) | $$(dir $$@)
263 $(QUIET)$(SED) \
264 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
265 -e "s;_BUILD_;$(date-utc );g" \
266 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
267 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
268 --output $@ \
269 $<
270
271#
272# .tar.bz2 for converting into .run
273#
274$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
275 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
276 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
277 $(VBOX_VERSION_STAMP)
278 $(call MSG_L1,Packing $@)
279 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
280 $(QUIET)$(MKDIR) -p $(@D)
281ifdef VBOX_USE_PBZIP2
282 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
283 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
284else
285 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
286endif
287 $(QUIET)$(CHMOD) 0644 $@
288
289#
290# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
291#
292$(PATH_BIN)/VirtualBox.tar.bz2: \
293 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
294 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
295 $(VBOX_VERSION_STAMP)
296 $(call MSG_L1,Packing $@)
297 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
298 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
299ifdef VBOX_USE_PBZIP2
300 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
301 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
302 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
303else
304 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
305 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
306endif
307 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
308
309
310# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
311$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
312 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
313 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
314 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
315 | $$(dir $$@)
316 $(call MSG_INST_FILE,$<,$@)
317 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
318 $(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),$@) $@)
319
320# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
321$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
322 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
323 $(call MSG_INST_FILE,$<,$@)
324ifeq ($(VBOX_DO_STRIP),)
325 $(QUIET)$(INSTALL) -m 0644 $< $@
326else # strip to temp file because of umask.
327 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
328 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
329 $(QUIET)$(RM) -f -- $@.tmp
330endif
331
332# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
333$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
334 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
335 $(call MSG_INST_SYM,$<,$@)
336 $(QUIET)$(RM) -f $@
337 $(QUIET)$(LN_SYMLINK) $< $@
338
339# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
340BLDDIRS += $(foreach d,\
341 archive \
342 archive/components \
343 archive/nls \
344 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
345 archive/additions \
346 install\
347,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
348
349
350#
351# .tar.bz2 for with the debug info.
352#
353$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
354 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
355 $(call MSG_L1,Packing $@)
356 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
357ifdef VBOX_USE_PBZIP2
358 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
359 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
360 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
361else
362 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
363 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
364endif
365
366# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
367$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
368 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
369 $(call MSG_TOOL,copydbg,$<,$@)
370 $(QUIET)objcopy --only-keep-debug $< $@
371
372# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
373BLDDIRS += $(foreach d,\
374 $(VBOX_LNX_DBG_PATH) \
375 $(VBOX_LNX_DBG_PATH)/components \
376,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
377
378include $(KBUILD_PATH)/subfooter.kmk
379
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