VirtualBox

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

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

Guest properties: initial commit of new interface

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