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