VirtualBox

source: vbox/trunk/src/VBox/Installer/freebsd/Makefile.kmk@ 92010

Last change on this file since 92010 was 92010, checked in by vboxsync, 3 years ago

FE/Qt: bugref:10127. Removing DocPath entries. They are KDE specific and requires kdoctools compliant documentation.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.6 KB
Line 
1# $Id: Makefile.kmk 92010 2021-10-22 16:10:47Z vboxsync $
2## @file
3# Makefile for the FreeBSD installer.
4#
5
6#
7# Copyright (C) 2006-2020 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
21ifneq ($(KBUILD_HOST),freebsd)
22 $(error "The FreeBSD installer can only be built on FreeBSD!")
23endif
24
25#
26# Globals and targets.
27#
28VBOX_PATH_FBSD_INST_SRC := $(PATH_SUB_CURRENT)
29VBOX_FBSD_INST_OUT_DIR := $(PATH_TARGET)/Installer/freebsd
30VBOX_FBSD_INST_STAGE_DIR := $(PATH_TARGET)/Installer/freebsd/install
31VBOX_FBSD_DBG_PATH := usr/lib/debug/opt/VirtualBox
32VBOX_FBSD_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).tbz
33VBOX_FBSD_INST_LIB_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/lib
34VBOX_FBSD_INST_BIN_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/bin
35VBOX_FBSD_INST_LIBVBOX_DIR := $(VBOX_FBSD_INST_LIB_DIR)/virtualbox
36VBOX_FBSD_INST_SHARE_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/share
37VBOX_FBSD_INST_SHAREAPP_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/applications
38VBOX_FBSD_INST_SHAREICON_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/pixmaps
39VBOX_FBSD_INST_SHAREVBOX_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/virtualbox
40
41# Unset this to speed up things during makefile hacking.
42VBOX_FBSD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
43
44BLDDIRS += $(VBOX_FBSD_INST_OUT_DIR) $(VBOX_FBSD_INST_STAGE_DIR)
45PACKING += $(PATH_STAGE_BIN)/$(VBOX_FBSD_PACKAGE_NAME)
46
47OTHER_CLEAN += \
48 $(addprefix $(VBOX_FBSD_INST_STAGE_DIR)/,\
49 pkg_plist \
50 LICENSE) \
51 $(wildcard $(VBOX_FBSD_INST_OUT_DIR)/VirtualBox-*)
52
53#
54# FreeBSD installs.
55#
56INSTALLS += freebsd-misc
57freebsd-misc_INST = bin/
58freebsd-misc_MODE = a+r,u+w
59freebsd-misc_SOURCES = \
60 $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
61 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
62 $(if $(VBOX_WITH_QTGUI),$(freebsd-misc_0_OUTDIR)/virtualbox.desktop,) \
63 $(if $(VBOX_WITH_QTGUI),$(freebsd-misc_0_OUTDIR)/virtualboxvm.desktop,)
64freebsd-misc_CLEAN = $(freebsd-misc_0_OUTDIR)/virtualbox.desktop
65freebsd-misc_CLEAN += $(freebsd-misc_0_OUTDIR)/virtualboxvm.desktop
66
67$$(PATH_freebsd-misc)/virtualbox.desktop: $(PATH_SUB_CURRENT)/virtualbox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
68 $(call MSG_GENERATE,,$@,$<)
69$$(PATH_freebsd-misc)/virtualboxvm.desktop: $(PATH_SUB_CURRENT)/virtualboxvm.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
70 $(call MSG_GENERATE,,$@,$<)
71
72
73
74#
75# The files residing in bin/ that we'll ship.
76#
77
78# Strip these binaries
79VBOX_FBSD_STRIP_BIN = \
80 VBoxDD.so \
81 VBoxDD2.so \
82 VBoxDDU.so \
83 VBoxVMM.so \
84 VBoxRT.so \
85 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
86 $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
87 $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
88 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
89 $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
90 VBoxHostChannel.so \
91 $(if $(VBOX_WITH_MAIN), \
92 VBoxManage \
93 VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
94 VBoxNetAdpCtl \
95 VBoxSVC \
96 VBoxXPCOM.so \
97 VBoxXPCOMC.so \
98 VBoxXPCOMIPCD \
99 components/VBoxXPCOMIPCC.so \
100 components/VBoxSVCM.so \
101 components/VBoxC.so,) \
102 VBoxTestOGL \
103 $(if $(VBOX_WITH_PYTHON),VBoxPython.so,) \
104 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,) \
105 $(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),VBoxAudioTest,)
106
107# Do not remove relocation information of these binaries
108VBOX_FBSD_STRIP_OBJ = \
109 VBoxDDRC.rc \
110 VBoxDDR0.r0 \
111 VMMRC.rc \
112 VMMR0.r0
113
114# Do not strip anything of these files
115VBOX_FBSD_NO_STRIP = \
116 $(if $(VBOX_OSE),,LICENSE) \
117 $(if $(VBOX_WITH_MAIN), \
118 components/VBoxXPCOMBase.xpt \
119 components/VirtualBox_XPCOM.xpt) \
120 vboxdrv.tar.gz
121
122# EFI firmware
123ifdef VBOX_WITH_EFIFW_PACKING
124 VBOX_FBSD_NO_STRIP += \
125 VBoxEFI32.fd \
126 VBoxEFI64.fd
127endif
128
129# Symlinks residing in bin/
130VBOX_FBSD_SYMLINKS = \
131 $(if $(VBOX_WITH_MAIN), \
132 VBoxManage \
133 VBoxSVC) \
134 $(if $(VBOX_WITH_VBOXSDL),VBoxSDL,) \
135 $(if $(VBOX_WITH_DTRACE),VBoxDTrace,) \
136 $(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),VBoxAudioTest,)
137
138# Qt GUI
139ifdef VBOX_WITH_QTGUI
140 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
141 VBOX_FBSD_STRIP_BIN += \
142 VBoxKeyboard.so \
143 VirtualBox \
144 $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
145 $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so DbgPlugInDiggers.so,)
146 VBOX_FBSD_SYMLINKS += \
147 VirtualBox
148 VBOX_FBSD_NO_STRIP += \
149 $(VBOX_LICENSE_FILES) \
150 $(if $(VBOX_WITH_ORACLE_QT),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
151 $(if $(VBOX_WITH_ORACLE_QT),accessible/libqtaccessiblewidgets.so,) \
152 $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
153 VBOX_FBSD_DESKTOP_FILE = \
154 virtualbox.desktop \
155 virtualboxvm.desktop
156 VBOX_FBSD_ICON_FILE = \
157 VBox.png
158endif
159
160# Guest Additions
161ifdef VBOX_WITH_ADDITIONS_PACKING
162 VBOX_FBSD_NO_STRIP += \
163 additions/VBoxGuestAdditions.iso
164endif
165
166# Documentation
167ifdef VBOX_WITH_DOCS_PACKING
168 VBOX_FBSD_NO_STRIP += \
169 VirtualBox.chm UserManual.pdf \
170 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
171 VBOX_FBSD_STRIP_BIN += \
172 $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
173endif
174
175# VRDP
176ifdef VBOX_WITH_VRDP
177 VBOX_FBSD_STRIP_BIN += \
178 VBoxVRDP.so \
179 VBoxAuth.so
180 VBOX_FBSD_NO_STRIP += \
181 rdesktop-vrdp.tar.gz
182 ifdef VBOX_WITH_VRDP_RDESKTOP
183# VBOX_FBSD_NO_STRIP += \
184# rdesktop-vrdp-keymaps
185 VBOX_FBSD_STRIP_BIN += \
186 rdesktop-vrdp
187 endif
188endif
189
190# Headless
191ifdef VBOX_WITH_HEADLESS
192 VBOX_FBSD_STRIP_BIN += \
193 VBoxHeadless \
194 $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
195 VBOX_FBSD_SYMLINKS += \
196 VBoxHeadless
197endif
198
199# Webservices
200ifdef VBOX_WITH_WEBSERVICES
201 VBOX_FBSD_STRIP_BIN += \
202 vboxwebsrv
203 VBOX_FBSD_SYMLINKS += \
204 vboxwebsrv
205endif
206
207# DTrace library, testcase and scripts (as the rest of this file, this makes bold
208# ASSUMPTIONS about VBPX_INST_XXX variable values).
209ifdef VBOX_WITH_DTRACE
210 VBOX_FBSD_NO_STRIP += \
211 $(addprefix dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
212 $(addprefix dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
213 $(addprefix dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES))
214endif
215
216#
217# All the bin files that goes into the archives.
218#
219VBOX_FBSD_ARCH_FILES := $(VBOX_FBSD_STRIP_BIN) $(VBOX_FBSD_STRIP_OBJ) $(VBOX_FBSD_NO_STRIP)
220
221# Cleanup of the files we copy/symlink from bin.
222OTHER_CLEAN += $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES))
223
224#
225# The module source archive
226#
227$(PATH_STAGE_BIN)/vboxdrv.tar.gz: \
228 src
229 $(call MSG_TOOL, export_modules.sh,,$@)
230 $(QUIET)$(PATH_STAGE_BIN)/export_modules.sh $@
231
232#
233# The generic installer.
234## @todo r=aeichner: Create pkg_plist dynamically based on the available features
235#
236$(PATH_STAGE_BIN)/$(VBOX_FBSD_PACKAGE_NAME): \
237 $(VBOX_VERSION_STAMP) \
238 $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
239 $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES)) \
240 $(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)) \
241 $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
242 $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)),) \
243 $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)),) \
244 $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
245 $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh
246 $(call MSG_TOOL,pkg_create,,$@)
247 $(QUIET)$(RM) -f $@
248 $(QUIET)pkg_create \
249 -I $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
250 -K $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh \
251 -c $(VBOX_PATH_FBSD_INST_SRC)/pkg-comment \
252 -d $(VBOX_PATH_FBSD_INST_SRC)/pkg-descr \
253 -f $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
254 -p /usr/local \
255 -s $(VBOX_FBSD_INST_STAGE_DIR) \
256 $@
257 $(QUIET)$(RM) -Rf $(VBOX_FBSD_INST_STAGE_DIR)
258
259$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_BIN)): \
260 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
261 $(call MSG_INST_FILE,$<,$@)
262 $(QUIET)$(INSTALL) -d $(dir $@)
263 $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
264
265# pattern rule for striping and copying the VBOX_FBSD_STRIP_OBJ files to install/lib/virtualbox
266$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_OBJ)): \
267 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
268 $(call MSG_INST_FILE,$<,$@)
269 $(QUIET)$(INSTALL) -d $(dir $@)
270ifeq ($(VBOX_DO_STRIP),)
271 $(QUIET)$(INSTALL) -m 0644 $< $@
272else # strip to temp file because of umask.
273 $(QUIET)objcopy --strip-unneeded -R .comment $< [email protected]
274 $(QUIET)$(INSTALL) -m 0644 [email protected] $@
275 $(QUIET)$(RM) -f -- [email protected]
276endif
277
278# pattern rule for linking the VBOX_FBSD_NO_STRIP into lib/virtualbox/
279$(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_NO_STRIP)): \
280 $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
281 $(call MSG_INST_FILE,$<,$@)
282 $(QUIET)$(INSTALL) -d $(dir $@)
283 $(QUIET)$(RM) -f $@
284 $(QUIET)$(INSTALL) -m 0644 $< $@
285
286# pattern rule for symlinking the VBOX_FBSD_SYMLINKS into bin/
287$(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)): \
288 $(VBOX_FBSD_INST_BIN_DIR)/% : $(PATH_STAGE_BIN)/%
289 $(call MSG_INST_SYM,$<,$@)
290 $(QUIET)$(INSTALL) -d $(dir $@)
291 $(QUIET)$(RM) -f $@
292 $(QUIET)$(LN_SYMLINK) ../lib/virtualbox/$(notdir $@) $@
293
294# pattern rule for copying the VBOX_FBSD_DESKTOP_FILE into share/applications/
295$(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)): \
296 $(VBOX_FBSD_INST_SHAREAPP_DIR)/% : $(PATH_STAGE_BIN)/%
297 $(call MSG_INST_FILE,$<,$@)
298 $(QUIET)$(INSTALL) -d $(dir $@)
299 $(QUIET)$(RM) -f $@
300 $(QUIET)$(INSTALL) -m 0644 $< $@
301
302# pattern rule for copying the VBOX_FBSD_ICON_FILE into share/pixmaps/
303$(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)): \
304 $(VBOX_FBSD_INST_SHAREICON_DIR)/% : $(PATH_STAGE_BIN)/%
305 $(call MSG_INST_FILE,$<,$@)
306 $(QUIET)$(INSTALL) -d $(dir $@)
307 $(QUIET)$(RM) -f $@
308 $(QUIET)$(INSTALL) -m 0644 $< $@
309
310# Create pkg_plist
311$(VBOX_FBSD_INST_OUT_DIR)/pkg_plist: \
312 $(VBOX_PATH_FBSD_INST_SRC)/pkg_plist
313 $(call MSG_INST_FILE,$<,$@)
314 $(QUIET)$(INSTALL) -d $(dir $@)
315 $(QUIET)$(CP) -- "$<" "$@"
316ifdef VBOX_WITH_DTRACE
317 $(QUIET)$(APPEND) -n "$@" "@mode 644" \
318 $(addprefix lib/virtualbox/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
319 $(addprefix lib/virtualbox/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
320 $(addprefix lib/virtualbox/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
321 "@mode 755" \
322 "bin/VBoxDTrace"
323endif
324
325include $(FILE_KBUILD_SUB_FOOTER)
326
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