VirtualBox

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

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

dead code

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.7 KB
Line 
1# $Id: Makefile.kmk 11890 2008-08-31 19:50:49Z 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
22DEPTH = ../../../..
23include $(KBUILD_PATH)/header.kmk
24
25ifneq ($(KBUILD_HOST),linux)
26$(error "The Linux installer can only be built on Linux!") # yeah, right.
27endif
28
29VBOX_NO_LINUX_RUN_INSTALLER ?= $(VBOX_OSE)
30PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
31
32PACKING = $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
33 $(PATH_BIN)/$(PACKAGE_NAME) $(PATH_BIN)/VirtualBox-dbg.tar.bz2)
34PACKING += $(PATH_BIN)/VirtualBox.tar.bz2
35
36ifdef VBOX_ONLY_SDK
37SDK_ZIP = $(PATH_BIN)/VirtualBoxSDK-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).zip
38PACKING = $(SDK_ZIP)
39endif
40
41OTHER_CLEAN = $(addprefix $(PATH_TARGET)/install/,\
42 install.sh deffiles routines.sh \
43 VBoxAddIF.sh vboxdrv.sh vboxnet.sh \
44 VirtualBox.tar.bz2 LICENSE) \
45 $(wildcard $(PATH_TARGET)/VirtualBox-*) \
46 $(PATH_TARGET)/vboxdrv.sh $(PATH_TARGET)/vboxnet.sh
47INSTALLS = linux-bin linux-doc
48
49#
50# Linux installs.
51#
52linux-bin_INST = bin/
53linux-bin_MODE = a+rx,u+w
54linux-bin_SOURCES = \
55 VBoxSysInfo.sh \
56 VBox.sh=>VBox.sh
57
58linux-doc_INST = bin/
59linux-doc_MODE = a+r,u+w
60linux-doc_SOURCES = \
61 $(if $(VBOX_OSE),,$(PATH_ROOT)/doc/License.txt=>LICENSE) \
62 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png
63
64# Strip these binaries
65LINUXSTRIPBIN = \
66 VBoxDD.so \
67 VBoxDD2.so \
68 $(if $(VBOX_WITH_FFMPEG),VBoxFFmpegFB.so,) \
69 VBoxManage \
70 VBoxREM.so \
71 VBoxRT.so \
72 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
73 VBoxSettings.so \
74 VBoxSVC \
75 VBoxDDU.so \
76 VBoxVMM.so \
77 VBoxXPCOM.so \
78 VBoxXPCOMIPCD \
79 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
80 VBoxTunctl \
81 components/VBoxC.so \
82 components/VBoxSVCM.so \
83 components/VBoxXPCOMIPCC.so
84
85# Do not remove relocation information of these binaries
86LINUXSTRIPOBJ = \
87 VBoxDD2GC.gc \
88 VBoxDD2R0.r0 \
89 VBoxDDGC.gc \
90 VBoxDDR0.r0 \
91 VMMGC.gc \
92 VMMR0.r0
93ifeq ($(KBUILD_TARGET_ARCH),amd64)
94LINUXSTRIPOBJ += \
95 VBoxREM2.rel
96endif
97
98# Do not strip anything of these files
99LINUXNOSTRIP = \
100 $(if $(VBOX_OSE),,LICENSE) \
101 $(if $(VBOX_WITH_QT4GUI),\
102 $(if $(VBOX_OSE),,License-$(VBOX_LICENSE_VER).html)) \
103 components/VBoxXPCOMBase.xpt \
104 components/VirtualBox_XPCOM.xpt \
105 VBoxSysInfo.sh \
106 VBox.sh \
107 VBox.png \
108 VBoxAddIF.sh \
109 $(if $(VBOX_WITH_QT4GUI),VirtualBox.desktop,) \
110 src
111
112# Qt4 GUI
113ifdef VBOX_WITH_QT4GUI
114 LINUXSTRIPBIN += \
115 VBoxKeyboard.so \
116 VirtualBox \
117 $(if $(VBOX_WITH_HARDENING),VirtualBox.so)
118 LINUXNOSTRIP += \
119 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_BIN)/libVBox*)),) \
120 $(foreach f,\
121 $(shell $(CAT_EXT) \
122 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox4/nls/ApprovedLanguages.txt),\
123 nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
124endif
125
126# Guest Additions
127LINUXNOSTRIP += \
128 $(if $(VBOX_OSE),,additions/VBoxGuestAdditions.iso)
129
130# Shared Folders
131LINUXSTRIPBIN += \
132 VBoxSharedFolders.so \
133 $(if $(VBOX_OSE),,VRDPAuth.so)
134
135# Shared Clipboard
136LINUXSTRIPBIN += \
137 VBoxSharedClipboard.so \
138 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so,)
139
140# Shared Info Services
141LINUXSTRIPBIN += \
142 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so)
143
144ifdef VBOX_WITH_DOCS
145 LINUXNOSTRIP += \
146 UserManual.pdf
147 LINUXSTRIPBIN += \
148 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
149 ifneq ($(wildcard $(PATH_BIN)/VirtualBox.chm),)
150 # our 64-bit tinderboxes are not able to generate VirtualBox.chm so far
151 # but for building .deb/.rpm packages we use precompiled binaries.
152 LINUXNOSTRIP += \
153 VirtualBox.chm
154 endif
155endif
156ifdef VBOX_WITH_VRDP
157 LINUXSTRIPBIN += \
158 VBoxVRDP.so
159
160 LINUXNOSTRIP += \
161 rdesktop-vrdp.tar.gz
162
163 ifdef VBOX_WITH_VRDP_RDESKTOP
164 LINUXNOSTRIP += \
165 rdesktop-vrdp-keymaps
166 LINUXSTRIPBIN += \
167 rdesktop-vrdp
168 endif
169endif
170ifdef VBOX_WITH_HEADLESS
171 LINUXSTRIPBIN += \
172 VBoxHeadless \
173 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
174endif
175ifdef VBOX_WITH_WEBSERVICES
176 LINUXSTRIPBIN += \
177 vboxwebsrv \
178 webtest
179endif
180
181LINUXARCHFILES := $(LINUXSTRIPBIN) $(LINUXSTRIPOBJ) $(LINUXNOSTRIP)
182DBGPATH := usr/lib/debug/opt/VirtualBox-$(VBOX_VERSION_STRING)
183
184OTHER_CLEAN += $(addprefix $(PATH_TARGET)/archive/,$(LINUXARCHFILES)) \
185 $(addprefix $(PATH_TARGET)/archive-dbg/$(DBGPATH)/,$(LINUXSTRIPBIN))
186
187include $(KBUILD_PATH)/footer.kmk
188
189$(PATH_BIN)/$(PACKAGE_NAME): \
190 $(PATH_TARGET)/install/VirtualBox.tar.bz2 \
191 install.sh \
192 $(VBOX_VERSION_STAMP) \
193 routines.sh \
194 deffiles \
195 $(PATH_TARGET)/vboxnet.sh \
196 $(PATH_TARGET)/vboxdrv.sh \
197 $(if $(VBOX_OSE),,$(PATH_ROOT)/doc/License.txt)
198 $(call MSG_TOOL,makeself,,$@)
199 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
200 $(QUIET)$(SED) \
201 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
202 -e "s;_BUILD_;$(date-utc );g" \
203 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
204 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
205 < install.sh > $(PATH_TARGET)/install/install.sh
206 $(QUIET)chmod 0744 $(PATH_TARGET)/install/install.sh
207 $(QUIET)$(INSTALL) -m 0755 routines.sh $(PATH_TARGET)/install
208 $(QUIET)$(INSTALL) -m 0755 deffiles $(PATH_TARGET)/install
209 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(PATH_ROOT)/doc/License.txt $(PATH_TARGET)/install/LICENSE)
210 $(QUIET)$(INSTALL) -m 0755 $(PATH_TARGET)/vboxnet.sh $(PATH_TARGET)/install
211 $(QUIET)$(INSTALL) -m 0755 $(PATH_TARGET)/vboxdrv.sh $(PATH_TARGET)/install
212 $(QUIET)$(RM) -f $@
213 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(PATH_TARGET)/install $@ \
214 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
215
216$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
217 $(addprefix $(PATH_TARGET)/archive-dbg/$(DBGPATH)/, $(LINUXSTRIPBIN))
218 $(call MSG_L1,Packing $@)
219 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(PATH_TARGET)/archive-dbg \
220 $(addprefix $(DBGPATH)/,$(LINUXSTRIPBIN))
221
222$(PATH_TARGET)/vboxdrv.sh: vboxdrv.sh.in
223 $(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g; s|%PACKAGE%|virtualbox|g" $< > $@
224
225$(PATH_TARGET)/vboxnet.sh: vboxnet.sh.in
226 $(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g" $< > $@
227
228# .tar.bz2 for converting into .run
229$(PATH_TARGET)/install/VirtualBox.tar.bz2: \
230 $(SDK_ZIP) \
231 $(addprefix $(PATH_TARGET)/archive/, $(LINUXARCHFILES)) \
232 Makefile.kmk \
233 $(VBOX_VERSION_STAMP) \
234 $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING)
235 $(call MSG_L1,Packing $@)
236 $(QUIET)$(MKDIR) -p $(@D)
237 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING) $(LINUXARCHFILES)
238 $(QUIET)chmod 0644 $@
239
240# .tar.bz2 for distribution
241$(PATH_BIN)/VirtualBox.tar.bz2: \
242 $(addprefix $(PATH_TARGET)/archive/, $(LINUXARCHFILES)) \
243 Makefile.kmk \
244 $(VBOX_VERSION_STAMP) \
245 $(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING)
246 $(call MSG_L1,Packing $@)
247 $(QUIET)$(MKDIR) -p $(PATH_TARGET)
248 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(PATH_TARGET) \
249 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(LINUXARCHFILES))
250
251
252
253ifneq ($(SDK_ZIP),)
254# make separate VirtualBox SDK delivery
255$(SDK_ZIP): \
256 $(PATH_BIN)/sdk \
257 $(VBOX_VERSION_STAMP)
258 $(call MSG_L1,Making SDK delivery $@)
259 $(QUIET)$(REDIRECT) -C $(PATH_BIN) -- zip -r9 $@ sdk > /dev/null
260endif
261
262$(PATH_TARGET)/VirtualBox-$(VBOX_VERSION_STRING): $(PATH_TARGET)/archive
263 $(call MSG_INST_SYM,$<,$@)
264 $(QUIET)$(MKDIR) -p $(@D)
265 $(QUIET)$(RM) -Rf -- $@
266 $(QUIET)$(LN_SYMLINK) $< $@
267
268$(PATH_BIN)/VBoxAddIF.sh: VBoxAddIF.sh $(VBOX_VERSION_STAMP)
269 $(call MSG_GENERATE,,$@,$<)
270 $(QUIET)$(SED) -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" $< > $@
271 $(QUIET)chmod 0755 $@
272
273$(PATH_BIN)/VirtualBox.desktop: VirtualBox.desktop $(VBOX_VERSION_STAMP)
274 $(call MSG_GENERATE,,$@,$<)
275ifdef VBOX_PATH_PACKAGE_DOCS
276 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" $< > $@
277else
278 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox-$(VBOX_VERSION_STRING)+" $< > $@
279endif
280
281$(addprefix $(PATH_TARGET)/archive/,$(LINUXSTRIPBIN)): \
282 $(PATH_TARGET)/archive/% : $(PATH_BIN)/% \
283 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
284 $(PATH_TARGET)/archive-dbg/$(DBGPATH)/%) \
285 | $$(call DIRDEP,$$(dir $$@))
286 $(call MSG_INST_FILE,$<,$@)
287 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
288 $(QUIET)$(if $(VBOX_NO_LINUX_RUN_INSTALLER),,objcopy --add-gnu-debuglink=$(subst $(PATH_TARGET)/archive,$(PATH_TARGET)/archive-dbg/$(DBGPATH),$@) $@)
289
290$(addprefix $(PATH_TARGET)/archive/,$(LINUXSTRIPOBJ)): \
291 $(PATH_TARGET)/archive/% : $(PATH_BIN)/% \
292 | $$(call DIRDEP,$$(dir $$@))
293 $(call MSG_INST_FILE,$<,$@)
294ifeq ($(VBOX_DO_STRIP),)
295 $(QUIET)$(INSTALL) -m 0644 $< $@
296else # strip to temp file because of umask.
297 $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
298 $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
299 $(QUIET)$(RM) -f -- $@.tmp
300endif
301
302$(addprefix $(PATH_TARGET)/archive/,$(LINUXNOSTRIP)): \
303 $(PATH_TARGET)/archive/% : $(PATH_BIN)/% \
304 | $$(call DIRDEP,$$(dir $$@))
305 $(call MSG_INST_SYM,$<,$@)
306 $(QUIET)$(RM) -f $@
307 $(QUIET)$(MKDIR) -p $(@D)
308 $(QUIET)$(LN_SYMLINK) $< $@
309
310$(foreach d,archive archive/components archive/nls archive/additions archive-dbg/$(DBGPATH) archive-dbg/$(DBGPATH)/components install,$(PATH_TARGET)/$(d)/):
311 $(QUIET)$(MKDIR) -p $@
312
313$(addprefix $(PATH_TARGET)/archive-dbg/$(DBGPATH)/,$(LINUXSTRIPBIN)): \
314 $(PATH_TARGET)/archive-dbg/$(DBGPATH)/% : $(PATH_BIN)/% \
315 | $(call DIRDEP,$(PATH_TARGET)/archive-dbg/$(DBGPATH)/components)
316 $(call MSG_TOOL,copydbg,$<,$@)
317 $(QUIET)objcopy --only-keep-debug $< $@
318
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