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