VirtualBox

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

Last change on this file since 14128 was 14015, checked in by vboxsync, 16 years ago

added vboxnetflt to the installer + some cleanup

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.4 KB
Line 
1# $Id: Makefile.kmk 14015 2008-11-10 13:57:45Z 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
22SUB_DEPTH = ../../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25ifneq ($(KBUILD_HOST),linux)
26 $(error "The Linux installer can only be built on Linux!")
27endif
28
29#
30# Globals and targets.
31#
32VBOX_PATH_LNX_INST_SRC := $(PATH_SUB_CURRENT)
33VBOX_LNX_INST_OUT_DIR := $(PATH_TARGET)/Installer/linux
34VBOX_LNX_INST_STAGE_DIR := $(PATH_TARGET)/Installer/linux/install
35VBOX_LNX_DBG_PATH := usr/lib/debug/opt/VirtualBox-$(VBOX_VERSION_STRING)
36VBOX_LNX_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
37
38# Unset this to speed up things during makefile hacking.
39VBOX_LNX_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
40
41BLDDIRS += $(VBOX_LNX_INST_OUT_DIR) $(VBOX_LNX_INST_STAGE_DIR)
42PACKING += $(PATH_BIN)/VirtualBox.tar.bz2
43if !defined(VBOX_NO_LINUX_RUN_INSTALLER) && !defined(VBOX_OSE)
44 PACKING += $(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME) \
45 $(PATH_BIN)/VirtualBox-dbg.tar.bz2
46endif
47
48OTHER_CLEAN += \
49 $(addprefix $(VBOX_LNX_INST_STAGE_DIR)/,\
50 install.sh \
51 deffiles \
52 routines.sh \
53 vboxdrv.sh \
54 vboxnet.sh \
55 VirtualBox.tar.bz2 \
56 LICENSE) \
57 $(wildcard $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-*) \
58 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/,\
59 vboxdrv.sh \
60 vboxnet.sh \
61 install.sh)
62
63#
64# Linux installs.
65#
66INSTALLS += linux-bin
67linux-bin_INST = bin/
68linux-bin_MODE = a+rx,u+w
69linux-bin_SOURCES = \
70 VBoxSysInfo.sh \
71 VBox.sh=>VBox.sh \
72 $(PATH_linux-bin)/VBoxAddIF.sh
73linux-bin_CLEAN = \
74 $(PATH_linux-bin)/VBoxAddIF.sh
75
76$$(PATH_linux-bin)/VBoxAddIF.sh: $(PATH_SUB_CURRENT)/VBoxAddIF.sh $(VBOX_VERSION_STAMP) | $$(dir $$@)
77 $(call MSG_GENERATE,,$@,$<)
78 $(QUIET)$(SED) -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" --output $@ $<
79
80INSTALLS += linux-misc
81linux-misc_INST = bin/
82linux-misc_MODE = a+r,u+w
83linux-misc_SOURCES = \
84 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
85 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
86 $(if $(VBOX_WITH_QT4GUI),$(PATH_linux-misc)/VirtualBox.desktop,)
87linux-misc_CLEAN = $(PATH_linux-misc)/VirtualBox.desktop
88
89$$(PATH_linux-misc)/VirtualBox.desktop: $(PATH_SUB_CURRENT)/VirtualBox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
90 $(call MSG_GENERATE,,$@,$<)
91ifdef VBOX_PATH_PACKAGE_DOCS
92 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
93else
94 $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox-$(VBOX_VERSION_STRING)+" --output $@ $<
95endif
96
97
98
99#
100# The files residing in bin/ that we'll ship.
101#
102
103# Strip these binaries
104VBOX_LNX_STRIP_BIN = \
105 VBoxDD.so \
106 VBoxDD2.so \
107 VBoxManage \
108 VBoxREM.so \
109 VBoxRT.so \
110 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
111 VBoxSettings.so \
112 VBoxSharedClipboard.so \
113 VBoxSharedFolders.so \
114 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so) \
115 VBoxSVC \
116 VBoxDDU.so \
117 VBoxVMM.so \
118 VBoxXPCOM.so \
119 VBoxXPCOMIPCD \
120 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
121 VBoxTunctl \
122 components/VBoxC.so \
123 components/VBoxSVCM.so \
124 components/VBoxXPCOMIPCC.so \
125 $(if $(VBOX_OSE),,VRDPAuth.so)
126
127
128# Do not remove relocation information of these binaries
129VBOX_LNX_STRIP_OBJ = \
130 VBoxDD2GC.gc \
131 VBoxDD2R0.r0 \
132 VBoxDDGC.gc \
133 VBoxDDR0.r0 \
134 VMMGC.gc \
135 VMMR0.r0
136ifeq ($(KBUILD_TARGET_ARCH),amd64)
137 VBOX_LNX_STRIP_OBJ += \
138 VBoxREM2.rel
139endif
140
141# Do not strip anything of these files
142VBOX_LNX_NO_STRIP = \
143 $(if $(VBOX_OSE),,LICENSE) \
144 components/VBoxXPCOMBase.xpt \
145 components/VirtualBox_XPCOM.xpt \
146 VBoxSysInfo.sh \
147 VBox.sh \
148 VBox.png \
149 VBoxAddIF.sh \
150 src
151
152# Qt4 GUI
153ifdef VBOX_WITH_QT4GUI
154 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox4/nls/ApprovedLanguages.kmk
155 VBOX_LNX_STRIP_BIN += \
156 VBoxKeyboard.so \
157 VirtualBox \
158 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
159 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
160 VBOX_LNX_NO_STRIP += \
161 VirtualBox.desktop \
162 $(VBOX_LICENSE_FILES) \
163 $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_BIN)/libVBox*)),) \
164 $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
165 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
166endif
167
168# Guest Additions
169ifdef VBOX_WITH_ADDITIONS_PACKING
170 VBOX_LNX_NO_STRIP += \
171 additions/VBoxGuestAdditions.iso
172endif
173
174
175# Documentation
176ifdef VBOX_WITH_DOCS_PACKING
177 VBOX_LNX_NO_STRIP += \
178 VirtualBox.chm UserManual.pdf \
179 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
180 VBOX_LNX_STRIP_BIN += \
181 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
182endif
183
184# VRDP
185ifdef VBOX_WITH_VRDP
186 VBOX_LNX_STRIP_BIN += \
187 VBoxVRDP.so
188 VBOX_LNX_NO_STRIP += \
189 rdesktop-vrdp.tar.gz
190 ifdef VBOX_WITH_VRDP_RDESKTOP
191 VBOX_LNX_NO_STRIP += \
192 rdesktop-vrdp-keymaps
193 VBOX_LNX_STRIP_BIN += \
194 rdesktop-vrdp
195 endif
196endif
197
198# Headless
199ifdef VBOX_WITH_HEADLESS
200 VBOX_LNX_STRIP_BIN += \
201 VBoxHeadless \
202 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
203endif
204
205# Webservices
206ifdef VBOX_WITH_WEBSERVICES
207 VBOX_LNX_STRIP_BIN += \
208 vboxwebsrv \
209 webtest
210endif
211
212#
213# All the bin files that goes into the archives.
214#
215VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP)
216
217# Cleanup of the files we copy/symlink from bin.
218OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_ARCH_FILES)) \
219 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
220
221
222#
223# The generic installer.
224#
225$(PATH_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
226 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
227 $(VBOX_VERSION_STAMP) \
228 $(VBOX_PATH_LNX_INST_SRC)/routines.sh \
229 $(VBOX_PATH_LNX_INST_SRC)/deffiles \
230 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
231 $(VBOX_LNX_INST_OUT_DIR)/vboxnet.sh \
232 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh \
233 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
234 $(wildcard $(PATH_BIN)/src/*) \
235 $(wildcard $(PATH_BIN)/src/*/*) \
236 $(wildcard $(PATH_BIN)/src/*/*/*) \
237 $(wildcard $(PATH_BIN)/src/*/*/*/*)
238 $(call MSG_TOOL,makeself,,$@)
239 $(QUIET)$(RM) -f $(wildcard $(PATH_BIN)/VirtualBox-*.run)
240 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/routines.sh $(VBOX_LNX_INST_STAGE_DIR)/
241 $(QUIET)$(INSTALL) -m 0755 $(VBOX_PATH_LNX_INST_SRC)/deffiles $(VBOX_LNX_INST_STAGE_DIR)/
242 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
243 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxnet.sh $(VBOX_LNX_INST_STAGE_DIR)/
244 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh $(VBOX_LNX_INST_STAGE_DIR)/
245 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
246 $(QUIET)$(RM) -f $@
247 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
248 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
249
250# files that needs editing before they can be included in the generic installer.
251$(VBOX_LNX_INST_OUT_DIR)/vboxdrv.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxdrv.sh.in | $$(dir $$@)
252 $(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g; s|%PACKAGE%|virtualbox|g" --output $@ $<
253
254$(VBOX_LNX_INST_OUT_DIR)/vboxnet.sh: $(VBOX_PATH_LNX_INST_SRC)/vboxnet.sh.in | $$(dir $$@)
255 $(QUIET)$(SED_EXT) -e "s|%NOLSB%|yes|g" --output $@ $<
256
257$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh | $$(dir $$@)
258 $(QUIET)$(SED) \
259 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
260 -e "s;_BUILD_;$(date-utc );g" \
261 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
262 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
263 --output $@ \
264 $<
265
266#
267# .tar.bz2 for converting into .run
268#
269$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: \
270 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
271 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
272 $(VBOX_VERSION_STAMP)
273 $(call MSG_L1,Packing $@)
274 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
275 $(QUIET)$(MKDIR) -p $(@D)
276ifdef VBOX_USE_PBZIP2
277 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
278 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
279else
280 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
281endif
282 $(QUIET)$(CHMOD) 0644 $@
283
284#
285# .tar.bz2 for distribution with the files under VirtualBox-<ver>/.
286#
287$(PATH_BIN)/VirtualBox.tar.bz2: \
288 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
289 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
290 $(VBOX_VERSION_STAMP)
291 $(call MSG_L1,Packing $@)
292 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
293 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
294ifdef VBOX_USE_PBZIP2
295 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR) \
296 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
297 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
298else
299 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
300 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
301endif
302 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
303
304
305# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
306$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
307 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% \
308 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
309 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
310 | $$(dir $$@)
311 $(call MSG_INST_FILE,$<,$@)
312 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
313 $(QUIET)$(if $(VBOX_NO_LINUX_RUN_INSTALLER),,objcopy --add-gnu-debuglink=$(subst $(VBOX_LNX_INST_OUT_DIR)/archive,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH),$@) $@)
314
315# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
316$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
317 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
318 $(call MSG_INST_FILE,$<,$@)
319ifeq ($(VBOX_DO_STRIP),)
320 $(QUIET)$(INSTALL) -m 0644 $< $@
321else # strip to temp file because of umask.
322 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
323 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
324 $(QUIET)$(RM) -f -- [email protected]
325endif
326
327# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
328$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
329 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_BIN)/% | $$(dir $$@)
330 $(call MSG_INST_SYM,$<,$@)
331 $(QUIET)$(RM) -f $@
332 $(QUIET)$(LN_SYMLINK) $< $@
333
334# rules for creating directories in archive (the pattern rules depends on these). ## @todo use BLDDIRS
335BLDDIRS += $(foreach d,\
336 archive \
337 archive/components \
338 archive/nls \
339 $(if $(VBOX_WITH_QT4_SUN),archive/accessible,) \
340 archive/additions \
341 install\
342,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
343
344
345#
346# .tar.bz2 for with the debug info.
347#
348$(PATH_BIN)/VirtualBox-dbg.tar.bz2: \
349 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/, $(VBOX_LNX_STRIP_BIN))
350 $(call MSG_L1,Packing $@)
351 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
352ifdef VBOX_USE_PBZIP2
353 $(QUIET)tar --owner 0 --group 0 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
354 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
355 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
356else
357 $(QUIET)tar --owner 0 --group 0 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
358 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN))
359endif
360
361# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
362$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
363 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_BIN)/% | $$(dir $$@)
364 $(call MSG_TOOL,copydbg,$<,$@)
365 $(QUIET)objcopy --only-keep-debug $< $@
366
367# rules for creating directories in archive-dbg (the pattern rules depends on these). ## @todo use BLDDIRS
368BLDDIRS += $(foreach d,\
369 $(VBOX_LNX_DBG_PATH) \
370 $(VBOX_LNX_DBG_PATH)/components \
371,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
372
373include $(KBUILD_PATH)/subfooter.kmk
374
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