1 | # $Id: Makefile.kmk 23632 2009-10-08 21:00:20Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the FreeBSD installer.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | SUB_DEPTH = ../../../..
|
---|
23 | include $(KBUILD_PATH)/subheader.kmk
|
---|
24 |
|
---|
25 | ifneq ($(KBUILD_HOST),freebsd)
|
---|
26 | $(error "The FreeBSD installer can only be built on FreeBSD!")
|
---|
27 | endif
|
---|
28 |
|
---|
29 | #
|
---|
30 | # Globals and targets.
|
---|
31 | #
|
---|
32 | VBOX_PATH_FBSD_INST_SRC := $(PATH_SUB_CURRENT)
|
---|
33 | VBOX_FBSD_INST_OUT_DIR := $(PATH_TARGET)/Installer/freebsd
|
---|
34 | VBOX_FBSD_INST_STAGE_DIR := $(PATH_TARGET)/Installer/freebsd/install
|
---|
35 | VBOX_FBSD_DBG_PATH := usr/lib/debug/opt/VirtualBox
|
---|
36 | VBOX_FBSD_PACKAGE_NAME = VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).tbz
|
---|
37 | VBOX_FBSD_INST_LIB_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/lib
|
---|
38 | VBOX_FBSD_INST_BIN_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/bin
|
---|
39 | VBOX_FBSD_INST_LIBVBOX_DIR := $(VBOX_FBSD_INST_LIB_DIR)/virtualbox
|
---|
40 | VBOX_FBSD_INST_SHARE_DIR := $(VBOX_FBSD_INST_STAGE_DIR)/share
|
---|
41 | VBOX_FBSD_INST_SHAREAPP_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/applications
|
---|
42 | VBOX_FBSD_INST_SHAREICON_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/pixmaps
|
---|
43 | VBOX_FBSD_INST_SHAREVBOX_DIR := $(VBOX_FBSD_INST_SHARE_DIR)/virtualbox
|
---|
44 |
|
---|
45 | # Unset this to speed up things during makefile hacking.
|
---|
46 | VBOX_FBSD_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
|
---|
47 |
|
---|
48 | BLDDIRS += $(VBOX_FBSD_INST_OUT_DIR) $(VBOX_FBSD_INST_STAGE_DIR)
|
---|
49 | PACKING += $(PATH_BIN)/$(VBOX_FBSD_PACKAGE_NAME)
|
---|
50 |
|
---|
51 | OTHER_CLEAN += \
|
---|
52 | $(addprefix $(VBOX_FBSD_INST_STAGE_DIR)/,\
|
---|
53 | pkg_plist \
|
---|
54 | LICENSE) \
|
---|
55 | $(wildcard $(VBOX_FBSD_INST_OUT_DIR)/VirtualBox-*)
|
---|
56 |
|
---|
57 | #
|
---|
58 | # FreeBSD installs.
|
---|
59 | #
|
---|
60 | INSTALLS += freebsd-misc
|
---|
61 | freebsd-misc_INST = bin/
|
---|
62 | freebsd-misc_MODE = a+r,u+w
|
---|
63 | freebsd-misc_SOURCES = \
|
---|
64 | $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/$(if $(VBOX_OSE),OSE,NonOSE)/VirtualBox_32px.png=>VBox.png \
|
---|
65 | $(if $(VBOX_OSE),,$(VBOX_BRAND_LICENSE_TXT)=>LICENSE) \
|
---|
66 | $(if $(VBOX_WITH_QTGUI),$(PATH_freebsd-misc)/virtualbox.desktop,)
|
---|
67 | freebsd-misc_CLEAN = $(PATH_freebsd-misc)/virtualbox.desktop
|
---|
68 |
|
---|
69 | $$(PATH_freebsd-misc)/virtualbox.desktop: $(PATH_SUB_CURRENT)/virtualbox.desktop $(VBOX_VERSION_STAMP) | $$(dir $$@)
|
---|
70 | $(call MSG_GENERATE,,$@,$<)
|
---|
71 | ifdef VBOX_PATH_PACKAGE_DOCS
|
---|
72 | $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+$(VBOX_PATH_PACKAGE_DOCS)+" --output $@ $<
|
---|
73 | else
|
---|
74 | $(QUIET)$(SED) -e "s+\$$VBOX_DOC_PATH+/opt/VirtualBox+" --output $@ $<
|
---|
75 | endif
|
---|
76 |
|
---|
77 |
|
---|
78 |
|
---|
79 | #
|
---|
80 | # The files residing in bin/ that we'll ship.
|
---|
81 | #
|
---|
82 |
|
---|
83 | # Strip these binaries
|
---|
84 | VBOX_FBSD_STRIP_BIN = \
|
---|
85 | VBoxDD.so \
|
---|
86 | VBoxDD2.so \
|
---|
87 | VBoxREM.so \
|
---|
88 | VBoxDDU.so \
|
---|
89 | VBoxVMM.so \
|
---|
90 | $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,) \
|
---|
91 | $(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,) \
|
---|
92 | VBoxRT.so \
|
---|
93 | $(if $(VBOX_WITH_VBOXSDL),VBoxSDL $(if $(VBOX_WITH_HARDENING),VBoxSDL.so),) \
|
---|
94 | $(if $(VBOX_WITH_SHARED_CLIPBOARD), VBoxSharedClipboard.so,) \
|
---|
95 | $(if $(VBOX_WITH_SHARED_FOLDERS), VBoxSharedFolders.so,) \
|
---|
96 | $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestPropSvc.so,) \
|
---|
97 | $(if $(VBOX_WITH_MAIN), \
|
---|
98 | VBoxManage \
|
---|
99 | VBoxNetDHCP $(if $(VBOX_WITH_HARDENING),VBoxNetDHCP.so,) \
|
---|
100 | VBoxNetAdpCtl \
|
---|
101 | VBoxSVC \
|
---|
102 | VBoxXPCOM.so \
|
---|
103 | VBoxXPCOMC.so \
|
---|
104 | VBoxXPCOMIPCD \
|
---|
105 | components/VBoxXPCOMIPCC.so \
|
---|
106 | components/VBoxSVCM.so \
|
---|
107 | components/VBoxC.so,) \
|
---|
108 | $(if $(VBOX_WITH_CROGL),\
|
---|
109 | VBoxOGLhostcrutil.so \
|
---|
110 | VBoxOGLhosterrorspu.so \
|
---|
111 | VBoxOGLrenderspu.so \
|
---|
112 | VBoxTestOGL \
|
---|
113 | VBoxSharedCrOpenGL.so,) \
|
---|
114 | $(if $(VBOX_WITH_PYTHON),VBoxPython.so,)
|
---|
115 |
|
---|
116 | # Do not remove relocation information of these binaries
|
---|
117 | VBOX_FBSD_STRIP_OBJ = \
|
---|
118 | VBoxDD2GC.gc \
|
---|
119 | VBoxDD2R0.r0 \
|
---|
120 | VBoxDDGC.gc \
|
---|
121 | VBoxDDR0.r0 \
|
---|
122 | VMMGC.gc \
|
---|
123 | VMMR0.r0
|
---|
124 |
|
---|
125 | # Do not strip anything of these files
|
---|
126 | VBOX_FBSD_NO_STRIP = \
|
---|
127 | $(if $(VBOX_OSE),,LICENSE) \
|
---|
128 | $(if $(VBOX_WITH_MAIN), \
|
---|
129 | components/VBoxXPCOMBase.xpt \
|
---|
130 | components/VirtualBox_XPCOM.xpt) \
|
---|
131 | vboxdrv.tar.gz
|
---|
132 |
|
---|
133 | # Symlinks residing in bin/
|
---|
134 | VBOX_FBSD_SYMLINKS = \
|
---|
135 | $(if $(VBOX_WITH_MAIN), \
|
---|
136 | VBoxManage \
|
---|
137 | VBoxSVC) \
|
---|
138 | $(if $(VBOX_WITH_VBOXSDL),VBoxSDL,)
|
---|
139 |
|
---|
140 | # Qt4 GUI
|
---|
141 | ifdef 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)
|
---|
148 | VBOX_FBSD_SYMLINKS += \
|
---|
149 | VirtualBox
|
---|
150 | VBOX_FBSD_NO_STRIP += \
|
---|
151 | $(VBOX_LICENSE_FILES) \
|
---|
152 | $(if $(VBOX_WITH_QT4_SUN),$(notdir $(wildcard $(PATH_BIN)/lib*VBox*)),) \
|
---|
153 | $(if $(VBOX_WITH_QT4_SUN),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 | VBOX_FBSD_ICON_FILE = \
|
---|
158 | VBox.png
|
---|
159 | endif
|
---|
160 |
|
---|
161 | # Guest Additions
|
---|
162 | ifdef VBOX_WITH_ADDITIONS_PACKING
|
---|
163 | VBOX_FBSD_NO_STRIP += \
|
---|
164 | additions/VBoxGuestAdditions.iso
|
---|
165 | endif
|
---|
166 |
|
---|
167 | # Documentation
|
---|
168 | ifdef VBOX_WITH_DOCS_PACKING
|
---|
169 | VBOX_FBSD_NO_STRIP += \
|
---|
170 | VirtualBox.chm UserManual.pdf \
|
---|
171 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),VirtualBox_$(f).chm UserManual_$(f).pdf)
|
---|
172 | VBOX_FBSD_STRIP_BIN += \
|
---|
173 | $(if $(VBOX_WITH_KCHMVIEWER),kchmviewer,)
|
---|
174 | endif
|
---|
175 |
|
---|
176 | # VRDP
|
---|
177 | ifdef VBOX_WITH_VRDP
|
---|
178 | VBOX_FBSD_STRIP_BIN += \
|
---|
179 | VBoxVRDP.so \
|
---|
180 | VRDPAuth.so
|
---|
181 | VBOX_FBSD_NO_STRIP += \
|
---|
182 | rdesktop-vrdp.tar.gz
|
---|
183 | ifdef VBOX_WITH_VRDP_RDESKTOP
|
---|
184 | # VBOX_FBSD_NO_STRIP += \
|
---|
185 | # rdesktop-vrdp-keymaps
|
---|
186 | VBOX_FBSD_STRIP_BIN += \
|
---|
187 | rdesktop-vrdp
|
---|
188 | endif
|
---|
189 | endif
|
---|
190 |
|
---|
191 | # Headless
|
---|
192 | ifdef VBOX_WITH_HEADLESS
|
---|
193 | VBOX_FBSD_STRIP_BIN += \
|
---|
194 | VBoxHeadless \
|
---|
195 | $(if $(VBOX_WITH_HARDENING),VBoxHeadless.so)
|
---|
196 | VBOX_FBSD_SYMLINKS += \
|
---|
197 | VBoxHeadless
|
---|
198 | endif
|
---|
199 |
|
---|
200 | # BFE
|
---|
201 | ifdef VBOX_WITH_VBOXBFE
|
---|
202 | VBOX_FBSD_STRIP_BIN += \
|
---|
203 | VBoxBFE \
|
---|
204 | $(if $(VBOX_WITH_HARDENING),VBoxBFE.so)
|
---|
205 | VBOX_FBSD_SYMLINKS += \
|
---|
206 | VBoxBFE
|
---|
207 | endif
|
---|
208 |
|
---|
209 | # Webservices
|
---|
210 | ifdef VBOX_WITH_WEBSERVICES
|
---|
211 | VBOX_FBSD_STRIP_BIN += \
|
---|
212 | vboxwebsrv \
|
---|
213 | webtest
|
---|
214 | VBOX_FBSD_SYMLINKS += \
|
---|
215 | vboxwebsrv
|
---|
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_BIN)/vboxdrv.tar.gz: \
|
---|
230 | src
|
---|
231 | $(call MSG_TOOL, export_modules,,$@)
|
---|
232 | $(QUIET)$(PATH_BIN)/export_modules $@
|
---|
233 |
|
---|
234 | #
|
---|
235 | # The generic installer.
|
---|
236 | # @todo r=aeichner: Create pkg_plist dynamically based on the available features
|
---|
237 | #
|
---|
238 | $(PATH_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_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_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 $< [email protected]
|
---|
276 | $(QUIET)$(INSTALL) -m 0644 [email protected] $@
|
---|
277 | $(QUIET)$(RM) -f -- [email protected]
|
---|
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_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_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_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_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)$(SED) \
|
---|
318 | -e "s;_VBOX_REM_32BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM32.so,);g" \
|
---|
319 | -e "s;_VBOX_REM_64BIT_MODULE_;$(if $(eq $(KBUILD_TARGET_ARCH),x86),VBoxREM64.so,);g" \
|
---|
320 | --output $@ \
|
---|
321 | $<
|
---|
322 |
|
---|
323 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
324 |
|
---|