1 | # $Id: Makefile.kmk 44528 2013-02-04 14:27:54Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the FreeBSD installer.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2013 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 | VBoxREM.so \
|
---|
84 | VBoxDDU.so \
|
---|
85 | VBoxVMM.so \
|
---|
86 | $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
|
---|
87 | $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
|
---|
88 | VBoxRT.so \
|
---|
89 | $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
|
---|
90 | $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
|
---|
91 | $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
|
---|
92 | $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
|
---|
93 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxGuestControlSvc.so,) \
|
---|
94 | VBoxHostChannel.so \
|
---|
95 | $(if $(VBOX_WITH_MAIN), \
|
---|
96 | VBoxManage \
|
---|
97 | VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
|
---|
98 | VBoxNetAdpCtl \
|
---|
99 | VBoxSVC \
|
---|
100 | VBoxXPCOM.so \
|
---|
101 | VBoxXPCOMC.so \
|
---|
102 | VBoxXPCOMIPCD \
|
---|
103 | components/VBoxXPCOMIPCC.so \
|
---|
104 | components/VBoxSVCM.so \
|
---|
105 | components/VBoxC.so,) \
|
---|
106 | $(if $(VBOX_WITH_CROGL),\
|
---|
107 | VBoxOGLhostcrutil.so \
|
---|
108 | VBoxOGLhosterrorspu.so \
|
---|
109 | VBoxOGLrenderspu.so \
|
---|
110 | VBoxTestOGL \
|
---|
111 | VBoxSharedCrOpenGL.so,) \
|
---|
112 | $(if $(VBOX_WITH_PYTHON),VBoxPython.so,)
|
---|
113 |
|
---|
114 | # Do not remove relocation information of these binaries
|
---|
115 | VBOX_FBSD_STRIP_OBJ = \
|
---|
116 | VBoxDD2GC.gc \
|
---|
117 | VBoxDD2R0.r0 \
|
---|
118 | VBoxDDGC.gc \
|
---|
119 | VBoxDDR0.r0 \
|
---|
120 | VMMGC.gc \
|
---|
121 | VMMR0.r0
|
---|
122 |
|
---|
123 | # Do not strip anything of these files
|
---|
124 | VBOX_FBSD_NO_STRIP = \
|
---|
125 | $(if $(VBOX_OSE),,LICENSE) \
|
---|
126 | $(if $(VBOX_WITH_MAIN), \
|
---|
127 | components/VBoxXPCOMBase.xpt \
|
---|
128 | components/VirtualBox_XPCOM.xpt) \
|
---|
129 | vboxdrv.tar.gz
|
---|
130 |
|
---|
131 | # EFI firmware
|
---|
132 | ifdef VBOX_WITH_EFIFW_PACKING
|
---|
133 | VBOX_FBSD_NO_STRIP += \
|
---|
134 | VBoxEFI32.fd \
|
---|
135 | VBoxEFI64.fd
|
---|
136 | endif
|
---|
137 |
|
---|
138 | # Symlinks residing in bin/
|
---|
139 | VBOX_FBSD_SYMLINKS = \
|
---|
140 | $(if $(VBOX_WITH_MAIN), \
|
---|
141 | VBoxManage \
|
---|
142 | VBoxSVC) \
|
---|
143 | $(if $(VBOX_WITH_VBOXSDL),VBoxSDL,)
|
---|
144 |
|
---|
145 | # Qt4 GUI
|
---|
146 | ifdef VBOX_WITH_QTGUI
|
---|
147 | include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
|
---|
148 | VBOX_FBSD_STRIP_BIN += \
|
---|
149 | VBoxKeyboard.so \
|
---|
150 | VirtualBox \
|
---|
151 | $(if $(VBOX_WITH_HARDENING),VirtualBox.so) \
|
---|
152 | $(if $(VBOX_WITH_DEBUGGER_GUI),VBoxDbg.so)
|
---|
153 | VBOX_FBSD_SYMLINKS += \
|
---|
154 | VirtualBox
|
---|
155 | VBOX_FBSD_NO_STRIP += \
|
---|
156 | $(VBOX_LICENSE_FILES) \
|
---|
157 | $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_STAGE_BIN)/lib*VBox*)),) \
|
---|
158 | $(if $(VBOX_WITH_QT4_SUN),accessible/libqtaccessiblewidgets.so,) \
|
---|
159 | $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES),nls/VirtualBox_$(f).qm nls/qt_$(f).qm)
|
---|
160 | VBOX_FBSD_DESKTOP_FILE = \
|
---|
161 | virtualbox.desktop
|
---|
162 | VBOX_FBSD_ICON_FILE = \
|
---|
163 | VBox.png
|
---|
164 | endif
|
---|
165 |
|
---|
166 | # Guest Additions
|
---|
167 | ifdef VBOX_WITH_ADDITIONS_PACKING
|
---|
168 | VBOX_FBSD_NO_STRIP += \
|
---|
169 | additions/VBoxGuestAdditions.iso
|
---|
170 | endif
|
---|
171 |
|
---|
172 | # Documentation
|
---|
173 | ifdef VBOX_WITH_DOCS_PACKING
|
---|
174 | VBOX_FBSD_NO_STRIP += \
|
---|
175 | VirtualBox.chm UserManual.pdf \
|
---|
176 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
|
---|
177 | VBOX_FBSD_STRIP_BIN += \
|
---|
178 | $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
|
---|
179 | endif
|
---|
180 |
|
---|
181 | # VRDP
|
---|
182 | ifdef VBOX_WITH_VRDP
|
---|
183 | VBOX_FBSD_STRIP_BIN += \
|
---|
184 | VBoxVRDP.so \
|
---|
185 | VBoxAuth.so
|
---|
186 | VBOX_FBSD_NO_STRIP += \
|
---|
187 | rdesktop-vrdp.tar.gz
|
---|
188 | ifdef VBOX_WITH_VRDP_RDESKTOP
|
---|
189 | # VBOX_FBSD_NO_STRIP += \
|
---|
190 | # rdesktop-vrdp-keymaps
|
---|
191 | VBOX_FBSD_STRIP_BIN += \
|
---|
192 | rdesktop-vrdp
|
---|
193 | endif
|
---|
194 | endif
|
---|
195 |
|
---|
196 | # Headless
|
---|
197 | ifdef VBOX_WITH_HEADLESS
|
---|
198 | VBOX_FBSD_STRIP_BIN += \
|
---|
199 | VBoxHeadless \
|
---|
200 | $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
|
---|
201 | VBOX_FBSD_SYMLINKS += \
|
---|
202 | VBoxHeadless
|
---|
203 | endif
|
---|
204 |
|
---|
205 | ## VBoxBFE - Follow the example set by Windows and Linux.
|
---|
206 | #ifdef VBOX_WITH_VBOXBFE
|
---|
207 | # VBOX_FBSD_STRIP_BIN += \
|
---|
208 | # VBoxBFE \
|
---|
209 | # $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
|
---|
210 | # VBOX_FBSD_SYMLINKS += \
|
---|
211 | # VBoxBFE
|
---|
212 | #endif
|
---|
213 |
|
---|
214 | # Webservices
|
---|
215 | ifdef VBOX_WITH_WEBSERVICES
|
---|
216 | VBOX_FBSD_STRIP_BIN += \
|
---|
217 | vboxwebsrv \
|
---|
218 | webtest
|
---|
219 | VBOX_FBSD_SYMLINKS += \
|
---|
220 | vboxwebsrv
|
---|
221 | endif
|
---|
222 |
|
---|
223 | #
|
---|
224 | # All the bin files that goes into the archives.
|
---|
225 | #
|
---|
226 | VBOX_FBSD_ARCH_FILES := $(VBOX_FBSD_STRIP_BIN) $(VBOX_FBSD_STRIP_OBJ) $(VBOX_FBSD_NO_STRIP)
|
---|
227 |
|
---|
228 | # Cleanup of the files we copy/symlink from bin.
|
---|
229 | OTHER_CLEAN += $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES))
|
---|
230 |
|
---|
231 | #
|
---|
232 | # The module source archive
|
---|
233 | #
|
---|
234 | $(PATH_STAGE_BIN)/vboxdrv.tar.gz: \
|
---|
235 | src
|
---|
236 | $(call MSG_TOOL, export_modules,,$@)
|
---|
237 | $(QUIET)$(PATH_STAGE_BIN)/export_modules $@
|
---|
238 |
|
---|
239 | #
|
---|
240 | # The generic installer.
|
---|
241 | # @todo r=aeichner: Create pkg_plist dynamically based on the available features
|
---|
242 | #
|
---|
243 | $(PATH_STAGE_BIN)/$(VBOX_FBSD_PACKAGE_NAME): \
|
---|
244 | $(VBOX_VERSION_STAMP) \
|
---|
245 | $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
|
---|
246 | $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_ARCH_FILES)) \
|
---|
247 | $(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)) \
|
---|
248 | $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)) \
|
---|
249 | $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)),) \
|
---|
250 | $(if $(VBOX_WITH_QTGUI),$(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)),) \
|
---|
251 | $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
|
---|
252 | $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh
|
---|
253 | $(call MSG_TOOL,pkg_create,,$@)
|
---|
254 | $(QUIET)$(RM) -f $@
|
---|
255 | $(QUIET)pkg_create \
|
---|
256 | -I $(VBOX_PATH_FBSD_INST_SRC)/postinstall.sh \
|
---|
257 | -K $(VBOX_PATH_FBSD_INST_SRC)/postdeinstall.sh \
|
---|
258 | -c $(VBOX_PATH_FBSD_INST_SRC)/pkg-comment \
|
---|
259 | -d $(VBOX_PATH_FBSD_INST_SRC)/pkg-descr \
|
---|
260 | -f $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist \
|
---|
261 | -p /usr/local \
|
---|
262 | -s $(VBOX_FBSD_INST_STAGE_DIR) \
|
---|
263 | $@
|
---|
264 | $(QUIET)$(RM) -Rf $(VBOX_FBSD_INST_STAGE_DIR)
|
---|
265 |
|
---|
266 | $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_BIN)): \
|
---|
267 | $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
268 | $(call MSG_INST_FILE,$<,$@)
|
---|
269 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
270 | $(QUIET)$(INSTALL) -m 0755 $(if $(VBOX_DO_STRIP),-s,) $< $@
|
---|
271 |
|
---|
272 | # pattern rule for striping and copying the VBOX_FBSD_STRIP_OBJ files to install/lib/virtualbox
|
---|
273 | $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_STRIP_OBJ)): \
|
---|
274 | $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
275 | $(call MSG_INST_FILE,$<,$@)
|
---|
276 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
277 | ifeq ($(VBOX_DO_STRIP),)
|
---|
278 | $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
279 | else # strip to temp file because of umask.
|
---|
280 | $(QUIET)objcopy --strip-unneeded -R .comment $< $@.tmp
|
---|
281 | $(QUIET)$(INSTALL) -m 0644 $@.tmp $@
|
---|
282 | $(QUIET)$(RM) -f -- $@.tmp
|
---|
283 | endif
|
---|
284 |
|
---|
285 | # pattern rule for linking the VBOX_FBSD_NO_STRIP into lib/virtualbox/
|
---|
286 | $(addprefix $(VBOX_FBSD_INST_LIBVBOX_DIR)/,$(VBOX_FBSD_NO_STRIP)): \
|
---|
287 | $(VBOX_FBSD_INST_LIBVBOX_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
288 | $(call MSG_INST_FILE,$<,$@)
|
---|
289 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
290 | $(QUIET)$(RM) -f $@
|
---|
291 | $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
292 |
|
---|
293 | # pattern rule for symlinking the VBOX_FBSD_SYMLINKS into bin/
|
---|
294 | $(addprefix $(VBOX_FBSD_INST_BIN_DIR)/,$(VBOX_FBSD_SYMLINKS)): \
|
---|
295 | $(VBOX_FBSD_INST_BIN_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
296 | $(call MSG_INST_SYM,$<,$@)
|
---|
297 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
298 | $(QUIET)$(RM) -f $@
|
---|
299 | $(QUIET)$(LN_SYMLINK) ../lib/virtualbox/$(notdir $@) $@
|
---|
300 |
|
---|
301 | # pattern rule for copying the VBOX_FBSD_DESKTOP_FILE into share/applications/
|
---|
302 | $(addprefix $(VBOX_FBSD_INST_SHAREAPP_DIR)/,$(VBOX_FBSD_DESKTOP_FILE)): \
|
---|
303 | $(VBOX_FBSD_INST_SHAREAPP_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
304 | $(call MSG_INST_FILE,$<,$@)
|
---|
305 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
306 | $(QUIET)$(RM) -f $@
|
---|
307 | $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
308 |
|
---|
309 | # pattern rule for copying the VBOX_FBSD_ICON_FILE into share/pixmaps/
|
---|
310 | $(addprefix $(VBOX_FBSD_INST_SHAREICON_DIR)/,$(VBOX_FBSD_ICON_FILE)): \
|
---|
311 | $(VBOX_FBSD_INST_SHAREICON_DIR)/% : $(PATH_STAGE_BIN)/%
|
---|
312 | $(call MSG_INST_FILE,$<,$@)
|
---|
313 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
314 | $(QUIET)$(RM) -f $@
|
---|
315 | $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
316 |
|
---|
317 | # Create pkg_plist
|
---|
318 | $(VBOX_FBSD_INST_OUT_DIR)/pkg_plist: \
|
---|
319 | $(VBOX_PATH_FBSD_INST_SRC)/pkg_plist
|
---|
320 | $(call MSG_INST_FILE,$<,$@)
|
---|
321 | $(QUIET)$(INSTALL) -d $(dir $@)
|
---|
322 | $(QUIET)$(SED) \
|
---|
323 | -e "s;_VBOX_REM_32BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,);g" \
|
---|
324 | -e "s;_VBOX_REM_64BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,);g" \
|
---|
325 | -e "/VBoxBFE/d" \
|
---|
326 | --output $@ \
|
---|
327 | $<
|
---|
328 |
|
---|
329 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
330 |
|
---|