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