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