VirtualBox

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

Last change on this file since 9687 was 9591, checked in by vboxsync, 17 years ago

linux builds: add version and revision to the package name

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