VirtualBox

source: vbox/trunk/src/VBox/Additions/Makefile.kmk@ 75819

Last change on this file since 75819 was 75465, checked in by vboxsync, 6 years ago

add: Ship OS/2 VBoxSF.ifs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.5 KB
Line 
1# $Id: Makefile.kmk 75465 2018-11-14 20:11:36Z vboxsync $
2## @file
3# Top-level makefile for the VirtualBox Guest Additions.
4#
5
6#
7# Copyright (C) 2006-2017 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
21#
22# Globals
23#
24VBOX_PATH_ADDITIONS_SRC := $(PATH_SUB_CURRENT)
25
26#
27# Cross building of the additions is generally done by remote building
28# by means of smbfs, cifs, VBOX_ONLY_ADDITIONS=1 and setting KBUILD_TARGET
29# and KBUILD_TARGET_ARCH to the desired target and architecture.
30#
31# Limited support for cross building the windows additions using wine
32# is provided. There are a couple of issues with the approach (lack of
33# signing, no VC++ 8 support, ++) that makes it unsuitable for releases.
34#
35#
36# Note! VBOX_WITH_ADDITIONS is checked for by our parent makefile.
37#
38# Note! VBOX_WITH_X11_ADDITIONS is set in Config.kmk
39#
40# Note! The additions build box will set the VBOX_WITH_ADDITIONS_ISO.win.x86
41# variables before invoking us from the root makefile.
42#
43# ==> All we have to worry about is what to do on the target we're on.
44#
45VBOX_WITH_ADDITIONS_ISO.$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH) = 1
46
47# Include sub-makefiles.
48include $(PATH_SUB_CURRENT)/common/Makefile.kmk
49
50ifndef VBOX_ONLY_VALIDATIONKIT
51 ifdef VBOX_WITH_X11_ADDITIONS
52 include $(PATH_SUB_CURRENT)/x11/Makefile.kmk
53 endif
54
55 ifeq ($(KBUILD_TARGET),freebsd)
56 include $(PATH_SUB_CURRENT)/freebsd/Makefile.kmk
57 endif
58 ifeq ($(KBUILD_TARGET),linux)
59 include $(PATH_SUB_CURRENT)/linux/Makefile.kmk
60 endif
61 ifeq ($(KBUILD_TARGET),os2)
62 include $(PATH_SUB_CURRENT)/os2/Makefile.kmk
63 endif
64 ifeq ($(KBUILD_TARGET),solaris)
65 include $(PATH_SUB_CURRENT)/solaris/Makefile.kmk
66 endif
67 ifeq ($(KBUILD_TARGET),win)
68 ifdef VBOX_WITH_MESA3D
69 include $(PATH_SUB_CURRENT)/3D/Makefile.kmk
70 endif
71 include $(PATH_SUB_CURRENT)/WINNT/Makefile.kmk
72 endif
73 ifeq ($(KBUILD_TARGET),darwin)
74 include $(PATH_SUB_CURRENT)/darwin/Makefile.kmk
75 endif
76 ifeq ($(KBUILD_TARGET),haiku)
77 include $(PATH_SUB_CURRENT)/haiku/Makefile.kmk
78 endif
79
80 ifeq ($(KBUILD_TARGET),linux)
81
82 INSTALLS += LnxAddIso-scripts
83 LnxAddIso-scripts_INST = $(INST_ADDITIONS)
84 LnxAddIso-scripts_MODE = a+rx,u+w
85 LnxAddIso-scripts_SOURCES = \
86 ../Installer/linux/runasroot.sh \
87 linux/installer/autorun.sh
88
89 endif # KBUILD_TARGET == linux
90 ifeq ($(KBUILD_TARGET),win)
91 #
92 # Inf2Cat requires all the files referenced in the .inf file
93 # to be present in the directory, so we have to do this from here,
94 # since VBoxGuest.sys is being built from the common sources.
95 #
96 INSTALLS += VBoxGuest-inf
97 VBoxGuest-inf_INST = $(INST_ADDITIONS)
98 VBoxGuest-inf_MODE = a+r,u+w
99 VBoxGuest-inf_SOURCES = \
100 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.inf
101 ifdef VBOX_SIGN_ADDITIONS
102 VBoxGuest-inf_SOURCES += \
103 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.cat \
104 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.sys \
105 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxControl.exe \
106 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxTray.exe
107 endif # signing
108 VBoxGuest-inf_CLEAN = $(VBoxGuest-inf_SOURCES)
109 VBoxGuest-inf_BLDDIRS = \
110 $(PATH_TARGET)/VBoxGuestCat.dir
111
112 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.inf: $(PATH_SUB_CURRENT)/common/VBoxGuest/win/VBoxGuest.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
113 $(call MSG_GENERATE,VBoxGuest-inf,$@,$<)
114 $(call VBOX_EDIT_INF_FN,$<,$@)
115
116 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.sys: $$(VBoxGuest_1_TARGET) | $$(dir $$@)
117 $(INSTALL) -m 644 $< $(@D)
118
119 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxControl.exe: $$(VBoxControl_1_TARGET) | $$(dir $$@)
120 $(INSTALL) -m 755 $< $(@D)
121
122 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxTray.exe: $$(VBoxTray_1_TARGET) | $$(dir $$@)
123 $(INSTALL) -m 755 $< $(@D)
124
125 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.cat: \
126 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.inf \
127 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxGuest.sys \
128 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxControl.exe \
129 $(PATH_TARGET)/VBoxGuestCat.dir/VBoxTray.exe
130 $(call MSG_TOOL,Inf2Cat,VBoxGuest-inf,$@,$<)
131 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
132 endif # KBUILD_TARGET == win
133
134 # The packing target rule, but only if we're on the local build box.
135 # (VBOX_WITHOUT_ADDITIONS_ISO is used by the additions build box, see the root makefile.)
136 ifndef VBOX_WITHOUT_ADDITIONS_ISO
137 PACKING += $(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.iso
138 endif
139endif # !VBOX_ONLY_VALIDATIONKIT
140
141include $(FILE_KBUILD_SUB_FOOTER)
142
143#
144# File per-OS/arch file specs for the additions iso (alphabetical order).
145#
146# We test for the VBOX_WITH_ADDITIONS_ISO.os.arch so that we don't have to
147# do the $(if )'ing down where the GUESTADDITIONS_FILESPEC.os.arch down
148# in the dependency list and RTIsoMaker command.
149#
150
151# Darwin / Mac OS X
152## @todo Create .pkg files not run files. The build server shall create a combined packaged, goverend by
153# the VBOX_WITH_COMBINED_DARWIN_GUEST_PACKAGE macro.
154ifdef VBOX_WITH_ADDITIONS_ISO.darwin.x86
155 VBOX_PATH_ADDITIONS.darwin.x86 = $(PATH_OUT_BASE)/darwin.x86/$(KBUILD_TYPE)/dist
156 GUESTADDITIONS_FILESPEC.darwin.x86 = \
157 VBoxDarwinAdditions-x86.dmg=$(VBOX_PATH_ADDITIONS.darwin.x86)/VBoxDarwinAdditions.dmg
158endif
159
160ifdef VBOX_WITH_ADDITIONS_ISO.darwin.amd64
161 VBOX_PATH_ADDITIONS.darwin.amd64 = $(PATH_OUT_BASE)/darwin.amd64/$(KBUILD_TYPE)/dist
162 GUESTADDITIONS_FILESPEC.darwin.amd64 = \
163 VBoxDarwinAdditions-amd64.dmg=$(VBOX_PATH_ADDITIONS.darwin.amd64)/VBoxDarwinAdditions.dmg
164endif
165
166# FreeBSD
167ifdef VBOX_WITH_ADDITIONS_ISO.freebsd.amd64
168 VBOX_PATH_ADDITIONS.freebsd.amd64 = $(PATH_OUT_BASE)/freebsd.amd64/$(KBUILD_TYPE)/bin/additions
169 GUESTADDITIONS_FILESPEC.freebsd.amd64 = \
170 VBoxFreeBSDAdditions-amd64.tbz=$(VBOX_PATH_ADDITIONS.freebsd.amd64)/VBoxFreeBSDAdditions.tbz
171endif
172ifdef VBOX_WITH_ADDITIONS_ISO.freebsd.x86
173 VBOX_PATH_ADDITIONS.freebsd.x86 = $(PATH_OUT_BASE)/freebsd.x86/$(KBUILD_TYPE)/bin/additions
174 GUESTADDITIONS_FILESPEC.freebsd.x86 = \
175 VBoxFreeBSDAdditions-x86.tbz=$(VBOX_PATH_ADDITIONS.freebsd.x86)/VBoxFreeBSDAdditions.tbz
176endif
177
178# GNU/Linux
179ifdef VBOX_WITH_ADDITIONS_ISO.linux.amd64
180 VBOX_PATH_ADDITIONS.linux.amd64 = $(PATH_OUT_BASE)/linux.amd64/$(KBUILD_TYPE)/bin/additions
181 ifdef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
182 VBOX_LNX_ADD_AMD64_RUN_PKG=VBoxLinuxAdditions.run
183 else
184 VBOX_LNX_ADD_AMD64_RUN_PKG=VBoxLinuxAdditions-amd64.run
185 endif
186 GUESTADDITIONS_FILESPEC.linux.amd64 = \
187 $(VBOX_LNX_ADD_AMD64_RUN_PKG)=$(VBOX_PATH_ADDITIONS.linux.amd64)/VBoxLinuxAdditions.run
188endif
189ifdef VBOX_WITH_ADDITIONS_ISO.linux.x86
190 VBOX_PATH_ADDITIONS.linux.x86 = $(PATH_OUT_BASE)/linux.x86/$(KBUILD_TYPE)/bin/additions
191## @todo 64-bit additions: rename this package, update docs (?) and tests (?). create wrapper? create gnome/kde autorun app (xplatform) ?
192 ifdef VBOX_WITH_COMBINED_LINUX_GUEST_PACKAGE
193 VBOX_LNX_ADD_X86_RUN_PKG=VBoxLinuxAdditions.run
194 else
195 VBOX_LNX_ADD_X86_RUN_PKG=VBoxLinuxAdditions-x86.run
196 endif
197 GUESTADDITIONS_FILESPEC.linux.x86 = \
198 $(VBOX_LNX_ADD_X86_RUN_PKG)=$(VBOX_PATH_ADDITIONS.linux.x86)/VBoxLinuxAdditions.run \
199 runasroot.sh=$(VBOX_PATH_ADDITIONS.linux.x86)/runasroot.sh \
200 autorun.sh=$(VBOX_PATH_ADDITIONS.linux.x86)/autorun.sh
201endif
202
203# IBM OS/2
204ifdef VBOX_WITH_ADDITIONS_ISO.os2.x86
205 VBOX_PATH_ADDITIONS.os2.x86 = $(PATH_OUT_BASE)/os2.x86/$(KBUILD_TYPE)/bin/additions
206 GUESTADDITIONS_FILESPEC.os2.x86 = \
207 OS2/VBoxGuest.sys=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxGuest.sys \
208 OS2/VBoxSF.ifs=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxSF.ifs\
209 OS2/VBoxService.exe=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxService.exe \
210 OS2/VBoxControl.exe=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxControl.exe \
211 OS2/VBoxReplaceDll.exe=$(VBOX_PATH_ADDITIONS.os2.x86)/VBoxReplaceDll.exe \
212 OS2/libc06.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc06.dll \
213 OS2/libc061.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc061.dll \
214 OS2/libc062.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc062.dll \
215 OS2/libc063.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc063.dll \
216 OS2/libc064.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc064.dll \
217 OS2/libc065.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc065.dll \
218 OS2/libc066.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/libc066.dll \
219 OS2/readme.txt=$(VBOX_PATH_ADDITIONS.os2.x86)/readme.txt \
220 \
221 OS2/gengradd.dll=$(VBOX_PATH_ADDITIONS.os2.x86)/gengradd.dll \
222 OS2/vboxmouse.sys=$(VBOX_PATH_ADDITIONS.os2.x86)/vboxmouse.sys
223endif
224
225# Oracle Solaris.
226ifdef VBOX_WITH_ADDITIONS_ISO.solaris.amd64
227 VBOX_PATH_ADDITIONS.solaris.amd64 = $(PATH_OUT_BASE)/solaris.amd64/$(KBUILD_TYPE)/bin/additions
228 GUESTADDITIONS_FILESPEC.solaris.amd64 = \
229 VBoxSolarisAdditions-amd64.pkg=$(VBOX_PATH_ADDITIONS.solaris.amd64)/VBoxSolarisAdditions.pkg
230endif
231ifdef VBOX_WITH_ADDITIONS_ISO.solaris.x86
232 VBOX_PATH_ADDITIONS.solaris.x86 = $(PATH_OUT_BASE)/solaris.x86/$(KBUILD_TYPE)/bin/additions
233 GUESTADDITIONS_FILESPEC.solaris.x86 = \
234 VBoxSolarisAdditions-x86.pkg=$(VBOX_PATH_ADDITIONS.solaris.x86)/VBoxSolarisAdditions.pkg
235endif
236ifdef VBOX_WITH_COMBINED_SOLARIS_GUEST_PACKAGE
237 # Build combined 32bit and 64bit solaris additions, not just a single arch.
238 # This assumes that the 32bit build directory contains the combined additions
239 # for 32bit and 64bit solaris. This just modifies variables set above.
240 GUESTADDITIONS_FILESPEC.solaris.x86 = \
241 VBoxSolarisAdditions.pkg=$(VBOX_PATH_ADDITIONS.solaris.x86)/VBoxSolarisAdditions.pkg
242 GUESTADDITIONS_FILESPEC.solaris.amd64 =
243endif
244
245# Microsoft Windows.
246ifdef VBOX_WITH_ADDITIONS_ISO.win.amd64
247 VBOX_PATH_ADDITIONS.win.amd64 = $(PATH_OUT_BASE)/win.amd64/$(KBUILD_TYPE)/bin/additions
248 VBOX_PATH_ADDITIONS.win = $(VBOX_PATH_ADDITIONS.win.amd64)
249 GUESTADDITIONS_FILESPEC.win.amd64 = \
250 VBoxWindowsAdditions-amd64.exe=$(VBOX_PATH_ADDITIONS.win.amd64)/VBoxWindowsAdditions-amd64.exe
251 ifndef VBOX_WITH_ADDITIONS_ISO.win.x86
252 GUESTADDITIONS_FILESPEC.win.amd64 += \
253 cert/VBoxCertUtil.exe=$(VBOX_PATH_ADDITIONS.win.amd64)/VBoxCertUtil.exe
254 endif
255endif
256
257ifdef VBOX_WITH_ADDITIONS_ISO.win.x86
258 VBOX_PATH_ADDITIONS.win.x86 = $(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/bin/additions
259 VBOX_PATH_ADDITIONS.win = $(VBOX_PATH_ADDITIONS.win.x86)
260 GUESTADDITIONS_FILESPEC.win.x86 = \
261 VBoxWindowsAdditions-x86.exe=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxWindowsAdditions-x86.exe \
262 VBoxWindowsAdditions.exe=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxWindowsAdditions.exe \
263 AUTORUN.INF=$(VBOX_PATH_ADDITIONS_SRC)/WINNT/Installer/ISO/AUTORUN.INF \
264 32Bit/Readme.txt=$(VBOX_PATH_ADDITIONS_SRC)/WINNT/Installer/ISO/ReadmeDrivers.txt \
265 64Bit/Readme.txt=$(VBOX_PATH_ADDITIONS_SRC)/WINNT/Installer/ISO/ReadmeDrivers.txt \
266 cert/VBoxCertUtil.exe=$(VBOX_PATH_ADDITIONS.win.x86)/VBoxCertUtil.exe
267endif # win.x86
268
269if defined(VBOX_WITH_ADDITIONS_ISO.win.amd64) || defined(VBOX_WITH_ADDITIONS_ISO.win.x86)
270 ifndef VBOX_SIGNING_MODE
271 GUESTADDITIONS_FILESPEC.win =
272 else if "$(VBOX_WITH_CORP_CODE_SIGNING)" == "all" || (!defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && !defined(VBOX_WITH_CORP_CODE_SIGNING))
273 GUESTADDITIONS_FILESPEC.win = cert/vbox.cer=$(VBOX_PATH_ADDITIONS.win)/vbox.cer
274 else
275 GUESTADDITIONS_FILESPEC.win = \
276 cert/vbox-sha1.cer=$(VBOX_PATH_ADDITIONS.win)/vbox-sha1.cer \
277 cert/vbox-sha256.cer=$(VBOX_PATH_ADDITIONS.win)/vbox-sha256.cer
278 if defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && defined(VBOX_WITH_CORP_CODE_SIGNING)
279 GUESTADDITIONS_FILESPEC.win += cert/vbox-sha256-r3.cer=$(VBOX_PATH_ADDITIONS.win)/vbox-sha256-r3.cer
280 endif
281 endif
282endif
283
284# haiku
285ifdef VBOX_WITH_ADDITIONS_ISO.haiku.x86
286 VBOX_PATH_ADDITIONS.haiku.x86 = $(PATH_OUT_BASE)/haiku.x86/$(KBUILD_TYPE)/bin/additions
287 # or bfs?
288 GUESTADDITIONS_FILESPEC.haiku.x86 = \
289 VBoxHaikuAdditions-x86.run=$(VBOX_PATH_ADDITIONS.haiku.x86)/VBoxHaikuAdditions-x86.run
290endif
291
292# For the iso rule.
293GUESTADDITIONS_FILESPEC_ALL = \
294 $(GUESTADDITIONS_FILESPEC.win) \
295 $(GUESTADDITIONS_FILESPEC.win.x86) \
296 $(GUESTADDITIONS_FILESPEC.win.amd64) \
297 $(GUESTADDITIONS_FILESPEC.solaris.x86) \
298 $(GUESTADDITIONS_FILESPEC.solaris.amd64) \
299 $(GUESTADDITIONS_FILESPEC.os2.x86) \
300 $(GUESTADDITIONS_FILESPEC.linux.x86) \
301 $(GUESTADDITIONS_FILESPEC.linux.amd64) \
302 $(GUESTADDITIONS_FILESPEC.freebsd.x86) \
303 $(GUESTADDITIONS_FILESPEC.freebsd.amd64) \
304 $(GUESTADDITIONS_FILESPEC.haiku.x86) \
305 $(GUESTADDITIONS_FILESPEC.darwin.x86) \
306 $(GUESTADDITIONS_FILESPEC.darwin.amd64)
307
308#
309# Build the Guest Additions ISO image.
310#
311ifndef VBOX_WITHOUT_ADDITIONS_ISO
312$(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.iso: \
313 $(filter-out %=deleteme=,$(subst =,=deleteme= , $(GUESTADDITIONS_FILESPEC_ALL))) \
314 $(VBOX_SVN_REV_KMK) \
315 $(VBOX_PATH_ADDITIONS_SRC)/Makefile.kmk \
316 | $(if-expr defined(VBOX_USE_RTISOMAKER),$(VBOX_RTISOMAKER),)
317 $(call MSG_TOOL,RTIsoMaker,,$@)
318 $(QUIET)$(MKDIR) -p $(@D)
319 $(VBOX_RTISOMAKER) \
320 --output $@ \
321 --iso-level 3 \
322 --rock-ridge \
323 --joliet \
324 --rational-attribs \
325 --random-order-verification 2048 \
326 $(addprefix /,$(GUESTADDITIONS_FILESPEC_ALL)) \
327 $(foreach spec, $(filter %.run %.sh,$(GUESTADDITIONS_FILESPEC_ALL)) \
328 , --chmod a+x:/$(substr $(spec), 1, $(expr $(pos =,$(spec)) - 1))) \
329 --volume-id="VBOXADDITIONS_$(VBOX_VERSION_STRING_RAW)_$(VBOX_SVN_REV)" \
330 --name-setup=joliet \
331 --volume-id="VBox_GAs_$(VBOX_VERSION_STRING_RAW)"
332
333$(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.zip: $(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.iso
334 $(call MSG_L1,Zipping image $@)
335 $(QUIET)$(RM) -f $@
336 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_ADDITIONS_ISO) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
337
338# Alias for creating the iso.
339.PHONY: additions-iso
340additions-iso: $(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.iso
341
342endif
343
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