VirtualBox

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

Last change on this file since 66025 was 66025, checked in by vboxsync, 8 years ago

bugref:4567: Linux kernel driver maintenance: do test builds of kernel modules as test cases; enable r113873 again.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.2 KB
Line 
1# $Id: Makefile.kmk 66025 2017-03-10 10:08:13Z vboxsync $
2## @file
3# Makefile for the Linux installer.
4#
5
6#
7# Copyright (C) 2006-2016 Oracle Corporation
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
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21# Include sub-makefiles.
22
23# We do not install VBoxHeadlessXOrg.sh any more, so this is not needed.
24#
25# ifdef VBOX_WITH_TESTCASES
26# include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
27# endif
28
29ifneq ($(KBUILD_HOST),linux)
30 $(error "The Linux installer can only be built on Linux!")
31endif
32
33#
34# Build test for the host kernel modules
35#
36
37ifdef VBOX_WITH_TESTCASES
38 ifndef VBOX_ONLY_SDK
39 VBOX_LNX_MOD_TEST=$(PATH_TARGET)/tsthost_mod
40 VBOX_LNX_MOD_TEST_TARGET=$(PATH_TARGET)/tsthost_mod.run
41 VBOX_LNX_MOD_SOURCES=$(vboxdrv-mod_2_INST_TARGETS) $(VBoxNetFlt-src_2_INST_TARGETS) $(VBoxNetFlt-src_2_INST_TARGETS) $(VBoxPci-src_2_INST_TARGETS)
42 TESTING += $(VBOX_LNX_MOD_TEST_TARGET)
43 OTHERS += $(VBOX_LNX_MOD_TEST_TARGET)
44 OTHER_CLEAN += $(VBOX_LNX_MOD_TEST)
45$$(VBOX_LNX_MOD_TEST_TARGET): $$(VBOX_LNX_MOD_SOURCES)
46 $(QUIET)$(call MSG_L1,Doing a test build of the host kernel modules)
47 $(QUIET)$(ASH) -c "rm -f $@"
48 $(QUIET)$(ASH) -c "mkdir -p $(VBOX_LNX_MOD_TEST) && cp -r $(PATH_STAGE_BIN)/src/* $(VBOX_LNX_MOD_TEST)"
49 $(QUIET)$(ASH) -c "cd $(VBOX_LNX_MOD_TEST) && make"
50 $(QUIET)$(APPEND) -t "$@" "done"
51 endif
52endif
53
54#
55# Globals and targets.
56#
57VBOX_LNX_APP_PRIVATE := $(if $(VBOX_PATH_APP_PRIVATE),$(VBOX_PATH_APP_PRIVATE),/opt/VirtualBox)
58VBOX_LNX_APP_DOCS := $(if $(VBOX_PATH_PACKAGE_DOCS),$(VBOX_PATH_PACKAGE_DOCS),\
59 $(if $(VBOX_PATH_APP_DOCS),$(VBOX_PATH_APP_DOCS),/opt/VirtualBox))
60VBOX_PATH_LNX_INST_SRC := $(PATH_SUB_CURRENT)
61VBOX_LNX_INST_OUT_DIR := $(PATH_TARGET)/Installer/linux
62VBOX_LNX_INST_STAGE_DIR := $(PATH_TARGET)/Installer/linux/install
63VBOX_LNX_INST_STAGE_DIR_REL := obj/Installer/linux/install
64VBOX_LNX_DBG_PATH := usr/lib/debug/$(VBOX_LNX_APP_PRIVATE)
65VBOX_LNX_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).run
66
67# Unset this to speed up things during makefile hacking.
68VBOX_LNX_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
69
70BLDDIRS += $(VBOX_LNX_INST_OUT_DIR) $(VBOX_LNX_INST_STAGE_DIR)
71if !defined(VBOX_NO_LINUX_RUN_INSTALLER)
72 PACKING += $(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME) \
73 $(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2
74else
75 PACKING += $(PATH_STAGE_BIN)/VirtualBox.tar
76endif
77
78OTHER_CLEAN += \
79 $(addprefix $(VBOX_LNX_INST_STAGE_DIR)/,\
80 install.sh \
81 VirtualBox.tar.bz2 \
82 LICENSE) \
83 $(wildcard $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-*) \
84 $(VBOX_LNX_INST_OUT_DIR)/install.sh
85
86#
87# Linux installs.
88#
89INSTALLS += linux-bin
90linux-bin_INST = bin/
91linux-bin_MODE = a+rx,u+w
92linux-bin_SOURCES = \
93 check_module_dependencies.sh \
94 postinst-common.sh \
95 prerm-common.sh \
96 routines.sh \
97 VBoxSysInfo.sh \
98 vboxautostart-service.sh \
99 vboxballoonctrl-service.sh \
100 VBoxCreateUSBNode.sh \
101 vboxdrv.sh \
102 vboxweb-service.sh \
103 VBox.sh=>VBox.sh \
104 $(if $(VBOX_WITH_PYTHON),$(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py=>vboxshell.py,)
105
106INSTALLS += linux-scripts
107linux-scripts_INST = $(VBOX_LNX_INST_STAGE_DIR_REL)/
108linux-scripts_MODE = a+rx,u+w
109linux-scripts_SOURCES = \
110 deffiles \
111 postinst-common.sh \
112 prerm-common.sh \
113 routines.sh \
114 uninstall.sh \
115 vboxautostart-service.sh \
116 vboxballoonctrl-service.sh \
117 vboxdrv.sh \
118 vboxweb-service.sh
119
120INSTALLS += linux-misc
121linux-misc_INST = bin/
122linux-misc_MODE = a+r,u+w
123linux-misc_SOURCES = \
124 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
125 $(VBOX_PATH_INST_COMMON_SRC)/virtualbox.xml \
126 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
127 $(linux-misc_0_OUTDIR)/generated.sh=>scripts/generated.sh \
128 $(if $(VBOX_WITH_QTGUI),$(linux-misc_0_OUTDIR)/virtualbox.desktop,)
129linux-misc_CLEAN = \
130 $(linux-misc_0_OUTDIR)/generated.sh \
131 $(linux-misc_0_OUTDIR)/virtualbox.desktop
132
133$$(linux-misc_0_OUTDIR)/generated.sh: $(VBOX_VERSION_STAMP) $(VBOX_LNX_INST_DEP_ON_MAKEFILE) | $$(dir $$@)
134 $(call MSG_GENERATE,,$@,$<)
135 $(QUIET)$(RM) -f '$@'
136 $(QUIET)$(APPEND) '$@' 'VBOX_PRODUCT="$(VBOX_PRODUCT)"'
137 $(QUIET)$(APPEND) '$@' 'VBOX_VERSION_STRING="$(VBOX_VERSION_STRING)"'
138 $(QUIET)$(APPEND) '$@' 'VBOX_C_YEAR="$(VBOX_C_YEAR)"'
139 $(QUIET)$(APPEND) '$@' 'VBOX_VENDOR="$(VBOX_VENDOR)"'
140
141$$(linux-misc_0_OUTDIR)/virtualbox.desktop: $(VBOX_PATH_INST_COMMON_SRC)/virtualbox.desktop.in $(VBOX_VERSION_STAMP) | $$(dir $$@)
142 $(call MSG_GENERATE,,$@,$<)
143 $(QUIET)$(SED) -e "s+@VBOX_DOC_PATH@+$(VBOX_LNX_APP_DOCS)+" \
144 -e "s+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+" \
145 --output $@ $<
146
147INSTALLS += linux-icons
148linux-icons_INST = bin/icons/
149linux-icons_MODE = a+r,u+w
150linux-icons_SOURCES = $(VBOX_MIME_ICONS) $(VBOX_DESKTOP_ICONS)
151
152
153#
154# The files residing in bin/ that we'll ship.
155#
156
157# Strip these binaries
158VBOX_LNX_STRIP_BIN = \
159 VBoxDD.so \
160 VBoxDD2.so \
161 VBoxREM.so \
162 VBoxDDU.so \
163 VBoxVMM.so \
164 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
165 $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
166 VBoxRT.so \
167 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
168 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
169 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
170 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
171 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
172 VBoxHostChannel.so \
173 $(if $(VBOX_WITH_DRAG_AND_DROP),VBoxDragAndDropSvc.so,) \
174 $(if $(VBOX_WITH_MAIN), \
175 VBoxAutostart \
176 VBoxBalloonCtrl \
177 VBoxBugReport \
178 VBoxManage \
179 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
180 $(if $(VBOX_WITH_LWIP_NAT),VBoxNetNAT $(if $(VBOX_WITH_HARDENING),VBoxNetNAT.so,),) \
181 VBoxNetAdpCtl \
182 $(if $(VBOX_WITH_DEVMAPPER),VBoxVolInfo,) \
183 VBoxSVC \
184 VBoxXPCOM.so \
185 VBoxXPCOMC.so \
186 VBoxXPCOMIPCD \
187 components/VBoxXPCOMIPCC.so \
188 components/VBoxSVCM.so \
189 components/VBoxC.so,) \
190 $(if $(VBOX_WITH_CROGL),\
191 VBoxOGLhostcrutil.so \
192 VBoxOGLhosterrorspu.so \
193 VBoxOGLrenderspu.so \
194 $(if $(VBOX_WITH_QTGUI),VBoxTestOGL,) \
195 VBoxSharedCrOpenGL.so,) \
196 $(if $(VBOX_WITH_VMSVGA3D),VBoxSVGA3D.so,) \
197 $(if $(VBOX_WITH_PYTHON),$(notdir $(wildcard $(PATH_STAGE_BIN)/VBoxPython*.so)),) \
198 $(if $(VBOX_WITH_JXPCOM),libvboxjxpcom.so,) \
199 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
200 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNC.so \
201 ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/VBoxVNCMain.so,) \
202 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,)\
203 VBoxTunctl
204
205# Do not remove relocation information of these binaries
206VBOX_LNX_STRIP_OBJ = \
207 VBoxDD2R0.r0 \
208 VBoxDDR0.r0 \
209 VMMR0.r0
210ifdef VBOX_NO_LINUX_RUN_INSTALLER
211 VBOX_LNX_STRIP_OBJ += \
212 VBoxDD2R0.debug \
213 VBoxDDR0.debug \
214 VMMR0.debug
215else
216 VBOX_LNX_DBG_BIN = \
217 VBoxDD2R0.debug \
218 VBoxDDR0.debug \
219 VMMR0.debug
220endif
221
222ifdef VBOX_WITH_RAW_MODE
223 VBOX_LNX_STRIP_OBJ += \
224 VBoxDD2RC.rc \
225 VBoxDDRC.rc \
226 VMMRC.rc
227 ifdef VBOX_NO_LINUX_RUN_INSTALLER
228 VBOX_LNX_STRIP_OBJ += \
229 VBoxDD2RC.debug \
230 VBoxDDRC.debug \
231 VMMRC.debug
232 else
233 VBOX_LNX_DBG_BIN += \
234 VBoxDD2RC.debug \
235 VBoxDDRC.debug \
236 VMMRC.debug
237 endif
238endif
239
240# Do not strip anything of these files
241VBOX_LNX_NO_STRIP = \
242 $(if $(VBOX_OSE),,LICENSE) \
243 $(if $(VBOX_WITH_MAIN), \
244 components/VBoxXPCOMBase.xpt \
245 components/VirtualBox_XPCOM.xpt) \
246 $(if $(VBOX_WITH_PYTHON),vboxshell.py,) \
247 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
248 ExtensionPacks/VNC/ExtPack.xml \
249 ExtensionPacks/VNC/ExtPack-license.html \
250 ExtensionPacks/VNC/ExtPack-license.rtf \
251 ExtensionPacks/VNC/ExtPack-license.txt,) \
252 check_module_dependencies.sh \
253 postinst-common.sh \
254 prerm-common.sh \
255 routines.sh \
256 VBoxSysInfo.sh \
257 vboxautostart-service.sh \
258 vboxballoonctrl-service.sh \
259 VBoxCreateUSBNode.sh \
260 vboxdrv.sh \
261 VBox.sh \
262 vboxweb-service.sh \
263 VBox.png \
264 $(if $(VBOX_WITH_UNATTENDED), \
265 unattended_templates/debian_preseed.cfg \
266 unattended_templates/ubuntu_preseed.cfg \
267 unattended_templates/fedora_ks.cfg \
268 unattended_templates/ol_ks.cfg \
269 unattended_templates/redhat67_ks.cfg \
270 unattended_templates/win_nt5_unattended.sif \
271 unattended_templates/win_nt6_unattended.xml,)
272
273ifdef VBOX_WITH_EXTPACK
274 VBOX_LNX_STRIP_BIN += \
275 VBoxExtPackHelperApp
276endif
277
278# Qt GUI
279ifdef VBOX_WITH_QTGUI
280 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
281 VBOX_LNX_STRIP_BIN += \
282 VBoxKeyboard.so \
283 VirtualBox \
284 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
285 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so DbgPlugInDiggers.so)
286 VBOX_LNX_NO_STRIP += \
287 virtualbox.desktop \
288 virtualbox.xml \
289 $(VBOX_LICENSE_FILES) \
290 $(if $(VBOX_WITH_ORACLE_QT),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
291 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm) \
292 icons
293 ifndef VBOX_WITH_QTGUI_V5
294 VBOX_LNX_NO_STRIP += \
295 $(if $(VBOX_WITH_ORACLE_QT),accessible/libqtaccessiblewidgets.so,)
296 else # VBOX_WITH_QTGUI_V5
297 VBOX_LNX_NO_STRIP += \
298 $(if $(VBOX_WITH_ORACLE_QT),$(VBOX_QT_PLUGINS)) \
299 $(addprefix legacy/,$(VBOX_QT_LEGACY_LIBS))
300 endif # VBOX_WITH_QTGUI_V5
301endif
302
303# Guest Additions
304ifdef VBOX_WITH_ADDITIONS_PACKING
305 VBOX_LNX_NO_STRIP += \
306 additions/VBoxGuestAdditions.iso
307endif
308
309# Documentation
310ifdef VBOX_WITH_DOCS_PACKING
311 VBOX_LNX_NO_STRIP += \
312 UserManual.pdf \
313 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),UserManual_$(f).pdf)
314 ifdef VBOX_WITH_DOCS_CHM
315 VBOX_LNX_NO_STRIP += \
316 VirtualBox.chm \
317 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm)
318 endif
319 VBOX_LNX_STRIP_BIN += \
320 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
321endif
322
323# auth stuff
324VBOX_LNX_STRIP_BIN += \
325 $(if $(VBOX_WITH_PAM),VBoxAuth.so,) \
326 VBoxAuthSimple.so
327
328# VRDP
329ifdef VBOX_WITH_VRDP
330 ifndef VBOX_WITH_EXTPACK_PUEL
331 VBOX_LNX_STRIP_BIN += \
332 VBoxVRDP.so
333 endif
334endif
335ifdef VBOX_WITH_VRDP_RDESKTOP
336 VBOX_LNX_NO_STRIP += \
337 rdesktop-vrdp.tar.gz
338 VBOX_LNX_NO_STRIP += \
339 rdesktop-vrdp-keymaps
340 VBOX_LNX_STRIP_BIN += \
341 rdesktop-vrdp
342endif
343
344# Python XPCOM glue
345ifdef VBOX_WITH_PYTHON
346 VBOX_LNX_NO_STRIP += \
347 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
348 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
349endif
350
351# Java XPCOM bridge
352ifdef VBOX_WITH_JXPCOM
353 VBOX_LNX_NO_STRIP += \
354 sdk/bindings/xpcom/java/vboxjxpcom.jar
355endif
356
357# Headless
358ifdef VBOX_WITH_HEADLESS
359 VBOX_LNX_STRIP_BIN += \
360 VBoxHeadless \
361 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
362endif
363
364# Webservices
365ifdef VBOX_WITH_WEBSERVICES
366 VBOX_LNX_STRIP_BIN += \
367 vboxwebsrv
368endif
369
370# vbox-img
371if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
372 VBOX_LNX_STRIP_BIN += \
373 vbox-img
374endif
375
376# EFI firmware
377ifdef VBOX_WITH_EFIFW_PACKING
378 VBOX_LNX_NO_STRIP += \
379 VBoxEFI32.fd \
380 VBoxEFI64.fd
381endif
382
383# DTrace library and scripts.
384ifdef VBOX_WITH_DTRACE
385 VBOX_LNX_NO_STRIP += \
386 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
387 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
388 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
389endif
390
391# Icons
392VBOX_MIME_ICONS = \
393 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/other/,\
394 $(foreach f,ova ovf vbox vbox-extpack vdi vmdk vhd hdd, \
395 $(foreach s,16 20 24 32 48 64 72 96 128 256,\
396 virtualbox-$(f)-$(s)px.png=>$(s)x$(s)/virtualbox-$(f).png)))
397
398VBOX_DESKTOP_ICONS = \
399 $(addprefix $(PATH_ROOT)/src/VBox/Artwork/$(if $(VBOX_OSE),OSE,NonOSE)/,\
400 $(foreach s,16 20 32 40 48 64 128,\
401 virtualbox-$(s)px.png=>$(s)x$(s)/virtualbox.png) \
402 virtualbox.svg=>scalable/virtualbox.svg)
403
404#
405# All the bin files that goes into the archives.
406#
407VBOX_LNX_ARCH_FILES := $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_STRIP_OBJ) $(VBOX_LNX_NO_STRIP) src
408
409# Cleanup of the files we copy/symlink from bin.
410OTHER_CLEAN += $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(filter-out src,$(VBOX_LNX_ARCH_FILES)) src/vboxhost) \
411 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
412 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
413
414#
415# The generic installer.
416#
417$(PATH_STAGE_BIN)/$(VBOX_LNX_PACKAGE_NAME): \
418 $(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2 \
419 $(VBOX_VERSION_STAMP) \
420 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
421 $(VBOX_LNX_INST_OUT_DIR)/install.sh \
422 $$(linux-scripts_2_STAGE_TARGETS)
423 $(call MSG_TOOL,makeself,,$@)
424 $(QUIET)$(RM) -f $(wildcard $(PATH_STAGE_BIN)/VirtualBox-*.run)
425 $(QUIET)$(if $(VBOX_OSE),,$(INSTALL) -m 0644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_LNX_INST_STAGE_DIR)/LICENSE)
426 $(QUIET)$(INSTALL) -m 0755 $(VBOX_LNX_INST_OUT_DIR)/install.sh $(VBOX_LNX_INST_STAGE_DIR)/
427 $(QUIET)$(RM) -f $@
428 $(QUIET)$(VBOX_MAKESELF) --follow --nocomp $(VBOX_LNX_INST_STAGE_DIR) $@ \
429 "VirtualBox for Linux installation" ./install.sh "\$$0 1> /dev/null"
430
431$(VBOX_LNX_INST_OUT_DIR)/install.sh: $(VBOX_PATH_LNX_INST_SRC)/install.sh $(VBOX_VERSION_STAMP) $(wildcard $(VBOX_SVN_REV_KMK).ts) | $$(dir $$@)
432 $(QUIET)$(SED) \
433 -e "s;_VERSION_;$(VBOX_VERSION_STRING);g" \
434 -e "s;_SVNREV_;$(VBOX_SVN_REV);g" \
435 -e "s;_BUILD_;$(date-utc );g" \
436 -e "s;_ARCH_;$(KBUILD_TARGET_ARCH);g" \
437 -e "s;_HARDENED_;$(VBOX_WITH_HARDENING);g" \
438 -e "s;_BUILDTYPE_;$(KBUILD_TYPE);g" \
439 -e "s;_USERNAME_;$(USERNAME);g" \
440 -e "s;_INSTALLATION_DIR_;$(VBOX_LNX_APP_PRIVATE);g" \
441 -e "s;_PYTHON_;$(VBOX_WITH_PYTHON);g" \
442 --output $@ \
443 $<
444
445#
446# The files that the tar archives depend on.
447#
448
449include $(PATH_ROOT)/src/VBox/HostDrivers/Support/linux/files_vboxdrv
450VBOX_LNX_INST_FILES_VBOXDRV=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxdrv/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(FILES_VBOXDRV_NOBIN)))))
451include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
452VBOX_LNX_INST_FILES_VBOXNETFLT=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetflt/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETFLT_SOURCES)))))
453include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
454VBOX_LNX_INST_FILES_VBOXNETADP=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxnetadp/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXNETADP_SOURCES)))))
455include $(PATH_ROOT)/src/VBox/HostDrivers/VBoxPci/linux/files_vboxpci
456VBOX_LNX_INST_FILES_VBOXPCI=$(patsubst =>%,$(PATH_STAGE_BIN)/src/vboxpci/%,$(filter =>%,$(subst =>, =>,$(subst $(DQUOTE),,$(VBOX_VBOXPCI_SOURCES)))))
457
458VBOX_LNX_INST_ARCH_DEPS := \
459 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/, $(VBOX_LNX_ARCH_FILES)) \
460 $(VBOX_LNX_INST_DEP_ON_MAKEFILE) \
461 $(VBOX_VERSION_STAMP) \
462 $(VBOX_LNX_INST_FILES_VBOXDRV) \
463 $(VBOX_LNX_INST_FILES_VBOXNETFLT) \
464 $(VBOX_LNX_INST_FILES_VBOXNETADP) \
465 $(VBOX_LNX_INST_FILES_VBOXPCI)
466
467#
468# .tar.bz2 for converting into .run
469#
470$(VBOX_LNX_INST_STAGE_DIR)/VirtualBox.tar.bz2: $(VBOX_LNX_INST_ARCH_DEPS)
471 $(call MSG_L1,Packing $@)
472 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
473 $(QUIET)$(MKDIR) -p $(@D)
474ifdef VBOX_USE_PBZIP2
475 $(QUIET)tar --dereference --owner 0 --group 0 \
476 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
477 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
478else
479 $(QUIET)tar --dereference --owner 0 --group 0 \
480 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive $(VBOX_LNX_ARCH_FILES)
481endif
482 $(QUIET)$(CHMOD) 0644 $@
483
484#
485# .tar for distribution with the files under VirtualBox-<ver>/.
486#
487$(PATH_STAGE_BIN)/VirtualBox.tar: $(VBOX_LNX_INST_ARCH_DEPS)
488 $(call MSG_L1,Packing $@)
489 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING) $@ $(patsubst %.bz2,%,$@)
490 $(QUIET)$(LN_SYMLINK) $(VBOX_LNX_INST_OUT_DIR)/archive/ $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
491 $(QUIET)tar --dereference --owner 0 --group 0 \
492 -cRhf $@ -C $(VBOX_LNX_INST_OUT_DIR) \
493 $(addprefix VirtualBox-$(VBOX_VERSION_STRING)/,$(VBOX_LNX_ARCH_FILES))
494 $(QUIET)$(RM) -f -- $(VBOX_LNX_INST_OUT_DIR)/VirtualBox-$(VBOX_VERSION_STRING)
495
496
497# pattern rule for stripping and copying the VBOX_LNX_STRIP_BIN files to archive/
498$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_BIN)): \
499 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% \
500 $(if $(VBOX_NO_LINUX_RUN_INSTALLER),,\
501 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/%) \
502 | $$(dir $$@)
503 $(call MSG_INST_FILE,$<,$@)
504 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
505 $(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),$@) $@)
506
507# pattern rule for copying VBOX_LNX_DBG_BIN files to archive-dbg/
508$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_DBG_BIN)): \
509 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
510 $(call MSG_INST_FILE,$<,$@)
511 $(QUIET)$(CP) $< $@
512
513# pattern rule for striping and copying the VBOX_LNX_STRIP_OBJ files to archive/
514$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_STRIP_OBJ)): \
515 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
516 $(call MSG_INST_FILE,$<,$@)
517ifeq ($(VBOX_DO_STRIP),)
518 $(QUIET)$(INSTALL) -m 0644 $< $@
519else # strip to temp file because of umask.
520 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
521 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
522 $(QUIET)$(RM) -f -- [email protected]
523endif
524
525# pattern rule for linking the VBOX_LNX_NO_STRIP into archive/
526$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive/,$(VBOX_LNX_NO_STRIP)): \
527 $(VBOX_LNX_INST_OUT_DIR)/archive/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
528 $(call MSG_INST_SYM,$<,$@)
529 $(QUIET)$(RM) -f $@
530 $(QUIET)$(LN_SYMLINK) $< $@
531
532# special rule for the kernel modules
533$(VBOX_LNX_INST_OUT_DIR)/archive/src: $(PATH_STAGE_BIN)/src | $(dir $@)
534 $(call MSG_INST_SYM,$<,$@)
535 $(QUIET)$(RM) -Rf $@
536 $(QUIET)$(MKDIR) $@
537 $(QUIET)$(LN_SYMLINK) $< $@/vboxhost
538
539# rules for creating directories in archive (the pattern rules depends on these).
540BLDDIRS += $(foreach d,\
541 archive \
542 archive/components \
543 archive/nls \
544 $(if $(VBOX_WITH_UNATTENDED),archive/unattended_templates,) \
545 $(if $(VBOX_WITH_ORACLE_QT),$(if $(VBOX_WITH_QTGUI_V5),,\
546 archive/accessible),) \
547 $(if $(VBOX_WITH_QTGUI_V5),\
548 archive/plugins/platforms \
549 archive/legacy,) \
550 $(if $(VBOX_WITH_PYTHON),\
551 archive/sdk/installer \
552 archive/sdk/installer/vboxapi \
553 archive/sdk/bindings/xpcom/python/xpcom \
554 archive/sdk/bindings/xpcom/python/xpcom/client \
555 archive/sdk/bindings/xpcom/python/xpcom/server,) \
556 $(if $(VBOX_WITH_JXPCOM),\
557 archive/sdk/bindings/xpcom/java,) \
558 $(if $(and $(VBOX_WITH_EXTPACK_VNC),$(VBOX_WITHOUT_EXTPACK_VNC_PACKING)), \
559 archive/ExtensionPacks/VNC \
560 archive/ExtensionPacks/VNC/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),) \
561 archive/additions \
562 install \
563 $(if $(VBOX_WITH_DTRACE),\
564 archive/dtrace \
565 archive/dtrace/lib \
566 archive/dtrace/lib/$(KBUILD_TARGET_ARCH) \
567 archive/dtrace/testcase/ \
568 archive/dtrace/testcase/$(KBUILD_TARGET_ARCH) \
569 archive/dtrace/scripts,) \
570,$(VBOX_LNX_INST_OUT_DIR)/$(d)/)
571
572
573#
574# .tar.bz2 for with the debug info.
575#
576$(PATH_STAGE_BIN)/VirtualBox-dbg.tar.bz2: \
577 $(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,\
578 $(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
579 $(call MSG_L1,Packing $@)
580 $(QUIET)$(RM) -f -- $@ $(patsubst %.bz2,%,$@)
581ifdef VBOX_USE_PBZIP2
582 $(QUIET)tar --dereference --owner 0 --group 0 \
583 -cRhf $(patsubst %.bz2,%,$@) -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
584 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
585 $(QUIET)pbzip2 $(patsubst %.bz2,%,$@)
586else
587 $(QUIET)tar --dereference --owner 0 --group 0 \
588 -cjRhf $@ -C $(VBOX_LNX_INST_OUT_DIR)/archive-dbg \
589 $(addprefix $(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN) $(VBOX_LNX_DBG_BIN))
590endif
591
592# pattern rule for copying the debug info from the VBOX_LNX_STRIP_BIN files into archive-dbg/$(VBOX_LNX_DBG_PATH)/
593$(addprefix $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/,$(VBOX_LNX_STRIP_BIN)): \
594 $(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(VBOX_LNX_DBG_PATH)/% : $(PATH_STAGE_BIN)/% | $$(dir $$@)
595 $(call MSG_TOOL,copydbg,$<,$@)
596 $(QUIET)objcopy --only-keep-debug $< $@
597
598# rules for creating directories in archive-dbg (the pattern rules depends on these).
599BLDDIRS += $(foreach d,\
600 $(VBOX_LNX_DBG_PATH) \
601 $(VBOX_LNX_DBG_PATH)/components \
602,$(VBOX_LNX_INST_OUT_DIR)/archive-dbg/$(d)/)
603
604include $(FILE_KBUILD_SUB_FOOTER)
605
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