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