VirtualBox

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

Last change on this file since 104932 was 103331, checked in by vboxsync, 9 months ago

Config.kmk,Main,libs/xpcom,HostDrivers/Support,Installer: Make VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC the default and remove the deprecated code, bugref:10594

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