VirtualBox

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

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

rdesktop-vrdp: Drop as it is too old and practically abandoned, bugref:10245

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