VirtualBox

source: vbox/trunk/src/VBox/HostDrivers/Support/Makefile.kmk@ 79891

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

*.kmk: Preparing for dropping 32-bit host support. Introducing a variable VBOX_SUPPORTED_HOST_ARCHS controlling what's supported and not. bugref:9511

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 30.4 KB
Line 
1# $Id: Makefile.kmk 79891 2019-07-19 16:16:19Z vboxsync $
2## @file
3# Sub-Makefile for the support library and the drivers/modules/kexts it uses.
4#
5
6#
7# Copyright (C) 2006-2019 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# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27SUB_DEPTH = ../../../..
28include $(KBUILD_PATH)/subheader.kmk
29
30#
31# Targets
32#
33LIBRARIES += SUPR3 SUPR3Static
34if defined(VBOX_WITH_HARDENING) \
35 && !defined(VBOX_ONLY_VALIDATIONKIT) \
36 && "$(intersects $(KBUILD_TARGET_ARCH),$(VBOX_SUPPORTED_HOST_ARCHS))" != ""
37 LIBRARIES += SUPR3HardenedStatic
38endif
39DLLS.win += VBoxSupLib
40ifdef VBOX_WITH_32_ON_64_MAIN_API
41 LIBRARIES += SUPR3-x86
42endif
43if !defined(VBOX_ONLY_DOCS)
44 if1of ($(VBOX_LDR_FMT), pe lx)
45 LIBRARIES += SUPR0
46 endif
47endif
48if !defined(VBOX_ONLY_BUILD) && defined(VBOX_WITH_RAW_MODE)
49 LIBRARIES += SUPRC
50endif
51if !defined(VBOX_ONLY_DOCS) \
52 && !defined(VBOX_ONLY_EXTPACKS) \
53 && !defined(VBOX_ONLY_VALIDATIONKIT) \
54 && "$(intersects $(KBUILD_TARGET_ARCH),$(VBOX_SUPPORTED_HOST_ARCHS))" != ""
55 ifdef VBOX_WITH_SUPSVC
56 PROGRAMS += VBoxSupSvc
57 endif
58 ifdef VBOX_WITH_VBOXDRV
59 LIBRARIES += SUPR0IdcClient
60 SYSMODS.os2 += VBoxDrv
61 endif
62 INSTALLS.linux += vboxdrv-src
63 INSTALLS.freebsd += vboxdrv-src
64
65 #
66 # Include sub-makefile(s).
67 #
68 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
69
70 #
71 # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
72 #
73 ifeq ($(KBUILD_TARGET),linux)
74 include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
75 endif
76 ifeq ($(KBUILD_TARGET),freebsd)
77 include $(PATH_SUB_CURRENT)/freebsd/files_vboxdrv
78 endif
79endif # !VBOX_ONLY_DOCS && !VBOX_ONLY_EXTPACKS && !VBOX_ONLY_VALIDATIONKIT
80
81#
82# Authenticode related trust anchors and certificates -> .cpp
83#
84VBOX_SUP_WIN_CERTS_FILE = $(SUPR3_0_OUTDIR)/TrustAnchorsAndCerts.cpp
85VBOX_SUP_WIN_CERTS := \
86 SpcRootMicrosoft0=SpcRoot-MicrosoftAuthenticodeTmRootAuthority-01.taf \
87 SpcRootMicrosoft1=SpcRoot-MicrosoftRootAuthority-00c1008b3c3c8811d13ef663ecdf40.taf \
88 SpcRootMicrosoft2=SpcRoot-MicrosoftRootCertificateAuthority-79ad16a14aa0a5ad4c7358f407132e65.taf \
89 SpcRootMicrosoft3=SpcRoot-MicrosoftRootCertificateAuthority2010-28cc3a25bfba44ac449a9b586b4339aa.taf \
90 SpcRootMicrosoft4=SpcRoot-MicrosoftRootCertificateAuthority2011-3f8bc8b5fc9fb29643b569d66c42e144.taf \
91 SpcRootMicrosoft5=SpcRoot-MicrosoftDigitalMediaAuthority2005-6eff330eb6e7569740680870104baaba.taf \
92 SpcRootMicrosoft6=SpcRoot-MicrosoftDevelopmentRootCertificateAuthority2014-078f0a9d03df119e434e4fec1bf0235a.taf \
93 NtRootMicrosoft7=NtRoot-MicrosoftCodeVerificationRoot-729404101f3e0ca347837fca175a8438.taf \
94 TimeRootMicrosoft0=Timestamp-CopyrightC1997MicrosoftCorp-01.taf \
95 TrustedCertVBox0=Trusted-OracleCorporationVirtualBox-05308b76ac2e15b29720fb4395f65f38.taf \
96 AppleRoot0=AppleRoot-2bd06947947609fef46b8d2e40a6f7474d7f085e.taf \
97 AppleRoot1=AppleRoot-G2-c499136c1803c27bc0a3a00d7f72807a1c77268d.taf
98VBOX_SUP_WIN_CERT_NAMES := $(foreach cert,$(VBOX_SUP_WIN_CERTS),$(firstword $(subst =,$(SPACE) ,$(cert))))
99VBOX_PATH_SUPR3_CERTIFICATES := $(PATH_SUB_CURRENT)/Certificates
100
101# 1=name, 2=filter, 3=buildcert?.
102if "$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING)
103 VBOX_SUP_GEN_CERT_MACRO = 'SUPTAENTRY const g_aSUP$(1)TAs[] =' '{' \
104 $(if-expr "$(3)" == "",,' SUPTAENTRY_GEN(g_abSUPBuildCert),') \
105 $(foreach certnm,$(filter $(2),$(VBOX_SUP_WIN_CERT_NAMES)), ' SUPTAENTRY_GEN(g_abSUP$(certnm)),') \
106 '};' 'unsigned const g_cSUP$(1)TAs = RT_ELEMENTS(g_aSUP$(1)TAs);' '' ''
107else
108 VBOX_SUP_GEN_CERT_MACRO = 'SUPTAENTRY const g_aSUP$(1)TAs[] =' '{' \
109 $(foreach certnm,$(filter $(2),$(VBOX_SUP_WIN_CERT_NAMES)), ' SUPTAENTRY_GEN(g_abSUP$(certnm)),') \
110 '};' 'unsigned const g_cSUP$(1)TAs = RT_ELEMENTS(g_aSUP$(1)TAs);' '' ''
111endif
112
113$$(VBOX_SUP_WIN_CERTS_FILE): $(MAKEFILE_CURRENT) \
114 $(foreach cert,$(VBOX_SUP_WIN_CERTS),$(VBOX_PATH_SUPR3_CERTIFICATES)/$(lastword $(subst =,$(SPACE) ,$(cert)))) \
115 $(VBOX_BIN2C) \
116 $(if-expr ("$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING)) \
117 || ("$(KBUILD_TARGET)" == "darwin" && defined(VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION) && defined(VBOX_SIGNING_MODE)) \
118 ,$(VBOX_RTSIGNTOOL)) \
119 | $$(dir $$@)
120 $(QUIET)$(RM) -f -- $@ [email protected]
121 $(QUIET)$(APPEND) -n "$@" \
122 '' \
123 '#include <VBox/sup.h>' \
124 ''
125 $(foreach cert,$(VBOX_SUP_WIN_CERTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append --static --no-size \
126 "SUP$(firstword $(subst =,$(SP) ,$(cert)))" \
127 "$(VBOX_PATH_SUPR3_CERTIFICATES)/$(lastword $(subst =,$(SP) ,$(cert)))" \
128 "$@")
129# The build certificate.
130if ("$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING) && defined(VBOX_SIGNING_MODE)) \
131 || ("$(KBUILD_TARGET)" == "darwin" && defined(VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION) && defined(VBOX_SIGNING_MODE))
132 $(VBOX_RTSIGNTOOL) extract-exe-signer-cert --exe $(VBOX_RTSIGNTOOL) --output "[email protected]" --der
133 $(VBOX_BIN2C) -ascii --append SUPBuildCert "[email protected]" $@
134 $(QUIET)$(RM) -f -- [email protected]
135endif
136# Generate certificate lists.
137 $(QUIET)$(APPEND) -n "$@" '' \
138 $(call VBOX_SUP_GEN_CERT_MACRO,All,%,build) \
139 $(call VBOX_SUP_GEN_CERT_MACRO,SpcRoot,SpcRoot%) \
140 $(call VBOX_SUP_GEN_CERT_MACRO,NtKernelRoot,NtRoot%) \
141 $(call VBOX_SUP_GEN_CERT_MACRO,Timestamp,TimeRoot%) \
142 $(call VBOX_SUP_GEN_CERT_MACRO,AppleRoot,AppleRoot%) \
143 $(call VBOX_SUP_GEN_CERT_MACRO,Trusted,TrustedCert%,build)
144
145tst: $(VBOX_SUP_WIN_CERTS_FILE)
146
147
148#
149# The Ring-3 Support Library (this is linked into the IPRT dll, VBoxRT).
150#
151SUPR3_TEMPLATE = VBOXR3
152SUPR3_DEFS = \
153 IN_SUP_R3 IN_RT_R3 \
154 $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC) \
155 $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,) \
156 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
157 $(if $(VBOX_WITH_REM),VBOX_WITH_REM,) \
158 VBOX_PERMIT_MORE \
159 VBOX_PERMIT_EVEN_MORE
160SUPR3_INCS := $(PATH_SUB_CURRENT)
161SUPR3_SOURCES = \
162 SUPLib.cpp \
163 SUPLibLdr.cpp \
164 SUPLibSem.cpp \
165 SUPLibTracerA.asm \
166 SUPLibAll.cpp \
167 SUPR3HardenedIPRT.cpp \
168 SUPR3HardenedVerify.cpp \
169 $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp \
170 $(VBOX_SUP_WIN_CERTS_FILE)
171ifdef VBOX_WITH_HARDENING
172 SUPR3_SOURCES.win = \
173 win/SUPHardenedVerifyImage-win.cpp
174endif
175
176SUPR3-x86_TEMPLATE = VBoxR3Dll-x86
177SUPR3-x86_EXTENDS = SUPR3
178
179
180#
181# Static version of SUPR3. This is more of a stub than anything else in a
182# hardened build, at least on windows.
183#
184SUPR3Static_TEMPLATE = VBOXR3STATIC
185SUPR3Static_EXTENDS = SUPR3
186SUPR3Static_DEFS = $(SUPR3_DEFS) IN_SUP_R3_STATIC
187SUPR3Static_SOURCES.win = $(filter-out win/SUPHardenedVerifyImage-win.cpp, $(SUPR3_SOURCES.win))
188
189
190#
191# The static part of the hardened support library (ring-3).
192#
193VBOX_PATH_RUNTIME_SRC ?= $(PATH_ROOT)/src/VBox/Runtime
194SUPR3HardenedStatic_TEMPLATE = VBOXR3HARDENEDLIB
195SUPR3HardenedStatic_DEFS = IN_SUP_HARDENED_R3
196SUPR3HardenedStatic_DEFS += \
197 $(if $(VBOX_WITH_SUPSVC),VBOX_WITH_SUPSVC,) \
198 $(if $(VBOX_WITH_MAIN),VBOX_WITH_MAIN,) \
199 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
200 $(if $(VBOX_WITH_REM),VBOX_WITH_REM,) \
201 $(if $(VBOX_WITHOUT_DEBUGGER_CHECKS),VBOX_WITHOUT_DEBUGGER_CHECKS,) \
202 $(if $(VBOX_PERMIT_VISUAL_STUDIO_PROFILING),VBOX_PERMIT_VISUAL_STUDIO_PROFILING,) \
203 VBOX_PERMIT_MORE \
204 VBOX_PERMIT_EVEN_MORE
205ifdef VBOX_WITH_VISTA_NO_SP
206 SUPR3HardenedStatic_DEFS.win += VBOX_WITH_VISTA_NO_SP
207endif
208SUPR3HardenedStatic_INCS = .
209SUPR3HardenedStatic_SOURCES = \
210 SUPR3HardenedMain.cpp \
211 SUPR3HardenedVerify.cpp \
212 SUPR3HardenedNoCrt.cpp \
213 $(KBUILD_TARGET)/SUPLib-$(KBUILD_TARGET).cpp
214SUPR3HardenedStatic_SOURCES.win = \
215 win/SUPR3HardenedMain-win.cpp \
216 win/SUPR3HardenedMainA-win.asm \
217 win/SUPR3HardenedMainImports-win.cpp \
218 win/SUPHardenedVerifyProcess-win.cpp \
219 win/SUPHardenedVerifyImage-win.cpp \
220 $(VBOX_SUP_WIN_CERTS_FILE)
221SUPR3HardenedStatic_SOURCES.x86 += \
222 $(VBOX_PATH_RUNTIME_SRC)/common/asm/ASMMemFirstMismatchingU8.asm
223SUPR3HardenedStatic_SOURCES.amd64 += \
224 $(VBOX_PATH_RUNTIME_SRC)/common/asm/ASMMemFirstMismatchingU8.asm
225
226
227if "$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING) ## @todo some of this move up.
228 SUPR3HardenedStatic_DEFS += \
229 IN_RT_R3 \
230 IN_RT_STATIC \
231 IN_DIS \
232 IN_DIS_STATIC \
233 DIS_CORE_ONLY \
234 IPRT_NO_CRT \
235 RT_WITH_NOCRT_ALIASES \
236 LOG_DISABLED \
237 IPRT_NO_ERROR_DATA \
238 IPRT_WITHOUT_DIGEST_MD4
239 SUPR3HardenedStatic_DEFS.win += LDR_ONLY_PE __STRALIGN_H_
240
241 SUPR3HardenedStatic_INCS += $(PATH_ROOT)/include/iprt/nocrt $(VBOX_PATH_RUNTIME_SRC)/include
242
243 SUPR3HardenedStatic_SOURCES += \
244 $(VBOX_PATH_RUNTIME_SRC)/common/ldr/ldr.cpp \
245 $(VBOX_PATH_RUNTIME_SRC)/common/ldr/ldrEx.cpp \
246 $(VBOX_PATH_RUNTIME_SRC)/common/ldr/ldrPE.cpp \
247 $(VBOX_PATH_RUNTIME_SRC)/common/alloc/heapsimple.cpp \
248 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-basics.cpp \
249 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-cursor.cpp \
250 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-default-allocator.cpp \
251 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-safer-allocator.cpp \
252 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-dump.cpp \
253 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-encode.cpp \
254 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-bitstring.cpp \
255 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-bitstring-decode.cpp \
256 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-boolean.cpp \
257 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-boolean-decode.cpp \
258 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-core.cpp \
259 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-core-decode.cpp \
260 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-dyntype.cpp \
261 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-dyntype-decode.cpp \
262 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-integer.cpp \
263 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-integer-decode.cpp \
264 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-null.cpp \
265 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-null-decode.cpp \
266 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-objid.cpp \
267 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-objid-decode.cpp \
268 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-octetstring.cpp \
269 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-octetstring-decode.cpp \
270 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-string.cpp \
271 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-string-decode.cpp \
272 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-time.cpp \
273 $(VBOX_PATH_RUNTIME_SRC)/common/asn1/asn1-ut-time-decode.cpp \
274 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/digest-core.cpp \
275 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/digest-builtin.cpp \
276 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/key.cpp \
277 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkcs7-asn1-decoder.cpp \
278 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkcs7-core.cpp \
279 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkcs7-init.cpp \
280 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkcs7-sanity.cpp \
281 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkcs7-verify.cpp \
282 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkix-signature-builtin.cpp \
283 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkix-signature-core.cpp \
284 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkix-signature-rsa.cpp \
285 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkix-verify.cpp \
286 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/pkix-util.cpp \
287 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/rsa-asn1-decoder.cpp \
288 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/rsa-core.cpp \
289 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/rsa-init.cpp \
290 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/rsa-sanity.cpp \
291 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/spc-asn1-decoder.cpp \
292 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/spc-core.cpp \
293 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/spc-init.cpp \
294 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/spc-sanity.cpp \
295 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-asn1-decoder.cpp \
296 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-certpaths.cpp \
297 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-core.cpp \
298 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-init.cpp \
299 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-sanity.cpp \
300 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/x509-verify.cpp \
301 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/store.cpp \
302 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/store-inmem.cpp \
303 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/taf-asn1-decoder.cpp \
304 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/taf-core.cpp \
305 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/taf-init.cpp \
306 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/taf-sanity.cpp \
307 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/tsp-asn1-decoder.cpp \
308 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/tsp-core.cpp \
309 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/tsp-init.cpp \
310 $(VBOX_PATH_RUNTIME_SRC)/common/crypto/tsp-sanity.cpp \
311 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/alt-md2.cpp \
312 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/alt-md5.cpp \
313 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/alt-sha1.cpp \
314 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/alt-sha256.cpp \
315 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/alt-sha512.cpp \
316 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/md2str.cpp \
317 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/md5str.cpp \
318 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/sha1str.cpp \
319 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/sha256str.cpp \
320 $(VBOX_PATH_RUNTIME_SRC)/common/checksum/sha512str.cpp \
321 $(VBOX_PATH_RUNTIME_SRC)/common/err/errinfo.cpp \
322 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathChangeToUnixSlashes.cpp \
323 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathExt.cpp \
324 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16PrintHexBytes.cpp \
325 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16ICmpAscii.cpp \
326 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16NICmpAscii.cpp \
327 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16CatAscii.cpp \
328 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16CopyAscii.cpp \
329 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16End.cpp \
330 $(VBOX_PATH_RUNTIME_SRC)/common/string/strstrip.cpp \
331 \
332 $(VBOX_PATH_RUNTIME_SRC)/common/err/errmsg.cpp \
333 $(VBOX_PATH_RUNTIME_SRC)/common/math/bignum.cpp \
334 $(VBOX_PATH_RUNTIME_SRC)/common/math/bignum-amd64-x86.asm \
335 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg1Weak.cpp \
336 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2.cpp \
337 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2Weak.cpp \
338 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2WeakV.cpp \
339 $(VBOX_PATH_RUNTIME_SRC)/common/misc/zero.asm \
340 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathAbsEx.cpp \
341 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathFilename.cpp \
342 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathParse.cpp \
343 $(VBOX_PATH_RUNTIME_SRC)/common/path/RTPathParsedReassemble.cpp \
344 $(VBOX_PATH_RUNTIME_SRC)/common/string/memchr.asm \
345 $(VBOX_PATH_RUNTIME_SRC)/common/string/memcmp.asm \
346 $(VBOX_PATH_RUNTIME_SRC)/common/string/memcpy.asm \
347 $(VBOX_PATH_RUNTIME_SRC)/common/string/memmove.asm \
348 $(VBOX_PATH_RUNTIME_SRC)/common/string/mempcpy.asm \
349 $(VBOX_PATH_RUNTIME_SRC)/common/string/memset.asm \
350 $(VBOX_PATH_RUNTIME_SRC)/common/string/strversion.cpp \
351 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrPrintHexBytes.cpp \
352 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrCat.cpp \
353 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrCmp.cpp \
354 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrCopy.cpp \
355 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrICmpAscii.cpp \
356 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrNCmp.cpp \
357 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTStrNLen.cpp \
358 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16Copy.cpp \
359 $(VBOX_PATH_RUNTIME_SRC)/common/string/RTUtf16NLenEx.cpp \
360 $(VBOX_PATH_RUNTIME_SRC)/common/string/strchr.asm \
361 $(VBOX_PATH_RUNTIME_SRC)/common/string/strcmp.asm \
362 $(VBOX_PATH_RUNTIME_SRC)/common/string/strcpy.asm \
363 $(VBOX_PATH_RUNTIME_SRC)/common/string/strformat.cpp \
364 $(VBOX_PATH_RUNTIME_SRC)/common/string/strformatrt.cpp \
365 $(VBOX_PATH_RUNTIME_SRC)/common/string/strformattype.cpp \
366 $(VBOX_PATH_RUNTIME_SRC)/common/string/strformatnum.cpp \
367 $(VBOX_PATH_RUNTIME_SRC)/common/string/stringalloc.cpp \
368 $(VBOX_PATH_RUNTIME_SRC)/common/string/strlen.asm \
369 $(VBOX_PATH_RUNTIME_SRC)/common/string/strncmp.asm \
370 $(VBOX_PATH_RUNTIME_SRC)/common/string/strncpy.asm \
371 $(VBOX_PATH_RUNTIME_SRC)/common/string/strprintf.cpp \
372 $(VBOX_PATH_RUNTIME_SRC)/common/string/strtonum.cpp \
373 $(VBOX_PATH_RUNTIME_SRC)/common/string/utf-16.cpp \
374 $(VBOX_PATH_RUNTIME_SRC)/common/string/utf-8.cpp \
375 $(VBOX_PATH_RUNTIME_SRC)/common/string/utf-8-case.cpp \
376 $(VBOX_PATH_RUNTIME_SRC)/common/string/unidata-upper.cpp \
377 $(VBOX_PATH_RUNTIME_SRC)/common/string/unidata-lower.cpp \
378 $(VBOX_PATH_RUNTIME_SRC)/common/time/time.cpp \
379 $(VBOX_PATH_RUNTIME_SRC)/generic/RTAssertShouldPanic-generic.cpp \
380 $(VBOX_PATH_RUNTIME_SRC)/generic/RTPathGetCurrentDrive-generic.cpp \
381 $(VBOX_PATH_RUNTIME_SRC)/generic/RTPathGetCurrentOnDrive-generic.cpp \
382 $(VBOX_PATH_RUNTIME_SRC)/generic/rtStrFormatKernelAddress-generic.cpp \
383 $(VBOX_PATH_RUNTIME_SRC)/generic/memsafer-generic.cpp \
384 $(VBOX_PATH_RUNTIME_SRC)/generic/uuid-generic.cpp \
385 \
386 ../../Disassembler/DisasmCore.cpp \
387 ../../Disassembler/DisasmTables.cpp \
388 ../../Disassembler/DisasmTablesX64.cpp \
389 ../../Disassembler/DisasmReg.cpp
390
391 SUPR3HardenedStatic_SOURCES.amd64 += \
392 $(VBOX_PATH_RUNTIME_SRC)/common/math/RTUInt128MulByU64.asm
393
394 SUPR3HardenedStatic_SOURCES.win += \
395 win/SUPR3HardenedNoCrt-win.cpp \
396 $(VBOX_PATH_RUNTIME_SRC)/nt/RTErrConvertFromNtStatus.cpp \
397 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathFindPossible8dot3Name.cpp \
398 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathExpand8dot3Path.cpp \
399 $(VBOX_PATH_RUNTIME_SRC)/nt/RTNtPathExpand8dot3PathA.cpp \
400 $(VBOX_PATH_RUNTIME_SRC)/r3/nt/pathint-nt.cpp \
401 $(VBOX_PATH_RUNTIME_SRC)/win/RTErrConvertFromWin32.cpp \
402 $(VBOX_PATH_RUNTIME_SRC)/win/errmsgwin.cpp
403
404 # Add necessary compiler specific files from libcmt.lib and the lib dir.
405 ifeq ($(KBUILD_TARGET),win)
406 SUPR3HardenedStatic_VBOX_LIBC_OBJS = chkstk.obj
407 ifeq ($(KBUILD_TARGET_ARCH),x86)
408 SUPR3HardenedStatic_VBOX_LIBC_OBJS += \
409 alloca16.obj \
410 ulldiv.obj \
411 ulldvrm.obj \
412 ullrem.obj \
413 ullshr.obj \
414 lldiv.obj \
415 lldvrm.obj \
416 llmul.obj \
417 llrem.obj \
418 llshl.obj \
419 llshr.obj \
420 rotl.obj \
421 rotr.obj
422 endif
423 SUPR3HardenedStatic_SOURCES.win += $(addprefix $(SUPR3HardenedStatic_0_OUTDIR)/,$(SUPR3HardenedStatic_VBOX_LIBC_OBJS))
424
425 $(addprefix $$(SUPR3HardenedStatic_0_OUTDIR)/,$(SUPR3HardenedStatic_VBOX_LIBC_OBJS)): \
426 $$(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.$(KBUILD_TARGET_ARCH))_LIB)/libcmt.lib | $$(dir $$@)
427 $(TOOL_$(TEMPLATE_VBOXR3HARDENEDEXE_TOOL.win.$(KBUILD_TARGET_ARCH))_AR) "$<" \
428 /EXTRACT:`$(TOOL_$(TEMPLATE_VBOXR3HARDENEDEXE_TOOL.win.$(KBUILD_TARGET_ARCH))_AR) "$<" /LIST \
429 | $(SED_EXT) -n -e '/[\\/:]$(notdir $@)/p'` \
430 "/OUT:$@"
431 endif
432endif
433
434# Things specific to the posix crowd.
435if1of ($(KBUILD_TARGET), linux darwin solaris)
436 SUPR3HardenedStatic_DEFS += \
437 IN_DIS \
438 IN_DIS_STATIC \
439 DIS_CORE_ONLY \
440 LOG_DISABLED
441 SUPR3HardenedStatic_DEFS.linux += \
442 SUP_HARDENED_WITH_DLMOPEN
443 SUPR3HardenedStatic_DEFS.solaris += \
444 SUP_HARDENED_WITH_DLMOPEN
445
446 SUPR3HardenedStatic_INCS += $(VBOX_PATH_RUNTIME_SRC)/include
447
448 SUPR3HardenedStatic_SOURCES += \
449 posix/SUPR3HardenedMain-posix.cpp \
450 posix/SUPR3HardenedMainA-posix.asm \
451 \
452 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg1Weak.cpp \
453 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2.cpp \
454 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2Weak.cpp \
455 $(VBOX_PATH_RUNTIME_SRC)/common/misc/RTAssertMsg2WeakV.cpp \
456 $(VBOX_PATH_RUNTIME_SRC)/generic/RTAssertShouldPanic-generic.cpp \
457 \
458 ../../Disassembler/DisasmCore.cpp \
459 ../../Disassembler/DisasmTables.cpp \
460 ../../Disassembler/DisasmTablesX64.cpp \
461 ../../Disassembler/DisasmReg.cpp
462endif
463
464SUPR3HardenedMain.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
465
466
467#
468# VBoxSupLib - Windows DLL for catching thread creation and termination.
469#
470VBoxSupLib_TEMPLATE = $(if-expr "$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING),VBOXR3HARDENEDLIB,VBOXR3)
471VBoxSupLib_SDKS.win = VBOX_NTDLL
472VBoxSupLib_LDFLAGS.win.amd64 = -Entry:DllMainEntrypoint
473VBoxSupLib_LDFLAGS.win.x86 = -Entry:DllMainEntrypoint
474VBoxSupLib_DEFS = \
475 $(if $(VBOX_WITHOUT_DEBUGGER_CHECKS),VBOX_WITHOUT_DEBUGGER_CHECKS,)
476VBoxSupLib_SOURCES = \
477 $(KBUILD_TARGET)/VBoxSupLib-$(KBUILD_TARGET).cpp
478VBoxSupLib_SOURCES.win = \
479 win/VBoxSupLib.rc
480VBoxSupLib_LIBS.win.x86 = \
481 $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/libcmt.lib # for __chkstk
482VBoxSupLib_LIBS.win.amd64 = \
483 $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt.lib # for __chkstk
484
485
486#
487# VBoxSupSvc - The system wide service/daemon.
488#
489VBoxSupSvc_TEMPLATE = VBOXR3EXE
490VBoxSupSvc_SOURCES = \
491 SUPSvc.cpp \
492 SUPSvcGlobal.cpp \
493 $(KBUILD_TARGET)/SUPSvc-$(KBUILD_TARGET).cpp
494if1of ($(KBUILD_TARGET), win)
495 VBoxSupSvc_SOURCES += \
496 SUPSvcGrant.cpp
497endif
498ifn1of ($(KBUILD_TARGET), win)
499 VBoxSupSvc_SOURCES += \
500 SUPSvcMain-posix.cpp
501endif
502VBoxSupSvc_LIBS = \
503 $(LIB_RUNTIME)
504
505
506#
507# SUPR0 - The Ring-0 Import library.
508#
509SUPR0_TEMPLATE = VBoxR0
510if1of ($(VBOX_LDR_FMT), pe lx)
511 SUPR0_SOURCES = $(SUPR0_0_OUTDIR)/SUPR0.def
512 SUPR0_CLEAN = $(SUPR0_0_OUTDIR)/SUPR0.def
513$$(SUPR0_0_OUTDIR)/SUPR0.def: \
514 $(PATH_SUB_CURRENT)/SUPDrv.cpp \
515 $(PATH_SUB_CURRENT)/SUPR0-def-$(VBOX_LDR_FMT).sed \
516 | $$(dir $$@)
517 $(SED) \
518 -f $(dir $<)/SUPR0-def-$(VBOX_LDR_FMT).sed \
519 --output $@ \
520 $<
521 # Experiment: Let's see how blunt the ones messing our NULL_THUNK_DATA entries on W10 are.
522 ifeq ($(KBUILD_TARGET),win)
523 ifdef KLIBTWEAKER_EXT
524 SUPR0_POST_CMDS = $(KLIBTWEAKER_EXT) --clear-timestamps --fill-null_thunk_data $(out)
525 endif
526 endif
527endif
528
529
530#
531# SUPRC - The raw-mode context library.
532#
533SUPRC_TEMPLATE := VBoxRc
534SUPRC_DEFS := IN_SUP_RC IN_RT_RC IN_VMM_RC
535SUPRC_SOURCES := SUPLibAll.cpp
536
537
538#
539# SUPR0IdcClient - The Ring-0 IDC client driver library.
540#
541SUPR0IdcClient_TEMPLATE = VBoxR0DrvLib
542SUPR0IdcClient_DEFS = IN_RT_R0 IN_SUP_R0 IN_SUP_STATIC
543SUPR0IdcClient_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
544SUPR0IdcClient_SOURCES.$(KBUILD_TARGET) = \
545 $(KBUILD_TARGET)/SUPR0IdcClient-$(KBUILD_TARGET).c
546SUPR0IdcClient_SOURCES = \
547 SUPR0IdcClient.c \
548 SUPR0IdcClientComponent.c \
549 SUPR0IdcClientStubs.c
550
551
552
553if !defined(VBOX_ONLY_DOCS) \
554 && !defined(VBOX_ONLY_EXTPACKS) \
555 && !defined(VBOX_ONLY_VALIDATIONKIT)
556
557ifeq ($(KBUILD_TARGET),os2)
558
559#
560# VBoxDrv.sys - The OS/2 driver.
561#
562VBoxDrv_TEMPLATE = VBOXR0DRV
563VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0
564VBoxDrv_INCS := $(PATH_SUB_CURRENT)
565#VBoxDrv_LDFLAGS = -s -t -v
566VBoxDrv_SOURCES = \
567 os2/SUPDrvA-os2.asm \
568 os2/SUPDrv-os2.def
569VBoxDrv_LIBS = \
570 $(VBoxDrvLib_1_TARGET) \
571 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
572 $(VBOX_GCC_LIBGCC) \
573 end
574
575# temp hack to ensure that SUPDrvA-os2.asm is first in the link.
576LIBRARIES += VBoxDrvLib
577VBoxDrvLib_TEMPLATE = VBOXR0DRV
578VBoxDrvLib_INSTTYPE = none
579VBoxDrvLib_DEFS = IN_RT_R0 IN_SUP_R0
580VBoxDrvLib_INCS := \
581 . \
582 $(PATH_ROOT)/src/VBox/Runtime/include
583VBoxDrvLib_SOURCES = \
584 os2/SUPDrv-os2.cpp \
585 SUPDrv.cpp \
586 SUPDrvGip.cpp \
587 SUPDrvSem.cpp \
588 SUPLibAll.cpp
589
590endif # os2
591
592
593#
594# New VBoxDrv target. TODO: Convert all the above to use this!
595#
596if1of ($(KBUILD_TARGET), darwin freebsd solaris win)
597 ifdef VBOX_WITH_VBOXDRV
598 SYSMODS += VBoxDrv
599 endif
600 VBoxDrv_TEMPLATE = VBOXR0DRV
601 VBoxDrv_NAME.freebsd = vboxdrv
602 VBoxDrv_NAME.solaris = vboxdrv
603 ifdef VBOX_SIGNING_MODE
604 VBoxDrv_INSTTYPE.win = none
605 VBoxDrv_DEBUG_INSTTYPE.win = both
606 endif
607 VBoxDrv_INST.darwin = $(INST_VBOXDRV)Contents/MacOS/
608 VBoxDrv_DEBUG_INST.darwin= $(patsubst %/,%,$(INST_VBOXDRV))
609 VBoxDrv_SDKS.win = ReorderCompilerIncs $(VBOX_WINDDK) $(VBOX_WINPSDK)INCS
610
611 VBoxDrv_DEFS := IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV)
612 ifdef VBOX_WITH_DTRACE_R0DRV
613 VBoxDrv_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R0DRV
614 endif
615 ifdef VBOX_WITHOUT_DEBUGGER_CHECKS
616 VBoxDrv_DEFS += VBOX_WITHOUT_DEBUGGER_CHECKS
617 endif
618 ifdef VBOX_PERMIT_VISUAL_STUDIO_PROFILING
619 VBoxDrv_DEFS += VBOX_PERMIT_VISUAL_STUDIO_PROFILING
620 endif
621 VBoxDrv_DEFS += VBOX_PERMIT_MORE VBOX_PERMIT_EVEN_MORE
622 #VBoxDrv_DEFS.debug += DEBUG_DARWIN_GIP
623 VBoxDrv_DEFS.darwin := VBOX_WITH_HOST_VMX
624 ifdef VBOX_WITH_RAW_MODE
625 VBoxDrv_DEFS.darwin += VBOX_WITH_RAW_MODE
626 endif
627 ifdef VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION
628 VBoxDrv_DEFS.darwin += VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION
629 endif
630 ifdef VBOX_WITH_NETFLT
631 VBoxDrv_DEFS.solaris += VBOX_WITH_NETFLT
632 endif
633 ifdef VBOX_WITH_NATIVE_SOLARIS_LOADING
634 VBoxDrv_DEFS.solaris += VBOX_WITH_NATIVE_SOLARIS_LOADING
635 endif
636 ifdef VBOX_WITHOUT_NATIVE_R0_LOADER
637 VBoxDrv_DEFS.win += VBOX_WITHOUT_NATIVE_R0_LOADER
638 endif
639 ifdef VBOX_WITH_VISTA_NO_SP
640 VBoxDrv_DEFS.win += VBOX_WITH_VISTA_NO_SP
641 endif
642 ifdef VBOX_WITH_HARDENING
643 VBoxDrv_ASDEFS += VBOX_WITH_HARDENING
644 endif
645 if ($(VBOX_VERSION_BUILD) % 2) == 1
646 VBoxDrv_DEFS += VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV IPRT_WITH_EFLAGS_AC_PRESERVING
647 endif
648
649 VBoxDrv_INCS = . $(VBoxDrv_0_OUTDIR)
650 VBoxDrv_INCS.darwin = ./darwin
651
652 VBoxDrv_LIBS = $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
653 VBoxDrv_LIBS.win = \
654 $(PATH_STAGE_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) \
655 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/ntoskrnl.lib \
656 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/hal.lib
657
658 #VBoxDrv_LDFLAGS.darwin = -Wl,-sectcreate,__TEXT,__info_plist,$(VBoxDrv.kext_0_OUTDIR)/Info.plist
659 #VBoxDrv_LDFLAGS.darwin = -v -Wl,-whyload -Wl,-v -Wl,-whatsloaded
660 VBoxDrv_LDFLAGS.solaris += -N misc/ctf
661 ifdef VBOX_WITH_NATIVE_DTRACE
662 VBoxDrv_LDFLAGS.solaris += -N drv/dtrace
663 endif
664 VBoxDrv_LDFLAGS.win.x86 = -Entry:DriverEntry@8
665 VBoxDrv_LDFLAGS.win.amd64= -Entry:DriverEntry
666
667 VBoxDrv_SOURCES.darwin = \
668 darwin/SUPDrv-darwin.cpp
669 ifdef VBOX_WITH_DARWIN_R0_DARWIN_IMAGE_VERIFICATION
670 VBoxDrv_SOURCES.darwin += \
671 $(VBOX_SUP_WIN_CERTS_FILE)
672 endif
673 VBoxDrv_SOURCES.solaris = \
674 solaris/SUPDrv-solaris.c
675 VBoxDrv_SOURCES.win = \
676 win/SUPDrv-win.cpp \
677 win/SUPDrvA-win.asm \
678 win/VBoxDrv.rc
679 ifdef VBOX_WITH_HARDENING
680 VBoxDrv_SOURCES.win += \
681 win/SUPHardenedVerifyImage-win.cpp \
682 win/SUPHardenedVerifyProcess-win.cpp \
683 $(VBOX_SUP_WIN_CERTS_FILE)
684 endif
685 VBoxDrv_SOURCES = \
686 SUPDrv.d \
687 SUPDrv.cpp \
688 SUPDrvGip.cpp \
689 SUPDrvSem.cpp \
690 SUPDrvTracer.cpp \
691 SUPLibAll.cpp
692 ifdef VBOX_WITH_NATIVE_DTRACE
693 VBoxDrv_SOURCES += \
694 SUPDrv-dtrace.cpp
695 SUPDrv-dtrace.cpp_DEFS.darwin += VBOX_PATH_MACOSX_DTRACE_H=\"$(VBOX_PATH_MACOSX_SDK)/usr/include/sys/dtrace.h\"
696 endif
697 ifn1of ($(KBUILD_TARGET), linux freebsd)
698 VBoxDrv_SOURCES += \
699 SUPDrvTracerA.asm
700 endif
701
702 linux/SUPDrv-linux.c_DEPS = $(VBOX_SVN_REV_HEADER)
703
704endif
705
706
707
708if1of ($(KBUILD_TARGET), darwin)
709 # Files necessary to make a darwin kernel extension bundle.
710 INSTALLS.darwin += VBoxDrv.kext
711 VBoxDrv.kext_INST = $(INST_VBOXDRV)Contents/
712 VBoxDrv.kext_SOURCES = $(VBoxDrv.kext_0_OUTDIR)/Contents/Info.plist
713 VBoxDrv.kext_CLEAN = $(VBoxDrv.kext_0_OUTDIR)/Contents/Info.plist
714 VBoxDrv.kext_BLDDIRS = $(VBoxDrv.kext_0_OUTDIR)/Contents/
715
716 $$(VBoxDrv.kext_0_OUTDIR)/Contents/Info.plist: \
717 $(PATH_SUB_CURRENT)/darwin/Info.plist \
718 $(VBOX_VERSION_MK) | $$(dir $$@)
719 $(call MSG_GENERATE,VBoxDrv,$@,$<)
720 $(QUIET)$(RM) -f $@
721 $(QUIET)$(SED) \
722 -e 's/@VBOX_VERSION_STRING@/$(if !defined(VBOX_MAVERICS_CODE_SIGNING_HACK),$(VBOX_VERSION_STRING),4.2.51)/g' \
723 -e 's/@VBOX_VERSION_MAJOR@/$(if !defined(VBOX_MAVERICS_CODE_SIGNING_HACK),$(VBOX_VERSION_MAJOR),4)/g' \
724 -e 's/@VBOX_VERSION_MINOR@/$(if !defined(VBOX_MAVERICS_CODE_SIGNING_HACK),$(VBOX_VERSION_MINOR),2)/g' \
725 -e 's/@VBOX_VERSION_BUILD@/$(if !defined(VBOX_MAVERICS_CODE_SIGNING_HACK),$(VBOX_VERSION_BUILD),51)/g' \
726 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
727 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
728 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
729 --output $@ \
730 $<
731
732 $(evalcall2 VBOX_TEST_SIGN_KEXT,VBoxDrv)
733endif
734
735
736if1of ($(KBUILD_TARGET), darwin solaris)
737 # Common manual loader script.
738 INSTALLS += SUPDrvScripts
739 SUPDrvScripts_INST = $(INST_DIST)
740 SUPDrvScripts_EXEC_SOURCES = \
741 $(KBUILD_TARGET)/load.sh
742endif
743
744
745if1of ($(KBUILD_TARGET), linux freebsd)
746 #
747 # Targets for installing the linux sources.
748 #
749 vboxdrv-src_INST = bin/src/vboxdrv/
750 vboxdrv-src_SOURCES = \
751 $(subst $(DQUOTE),,$(FILES_VBOXDRV_NOBIN)) \
752 $(vboxdrv-src_0_OUTDIR)/Makefile
753 vboxdrv-src_EXEC_SOURCES = \
754 $(subst $(DQUOTE),,$(FILES_VBOXDRV_BIN))
755 vboxdrv-src_CLEAN = \
756 $(vboxdrv-src_0_OUTDIR)/Makefile \
757 $(PATH_TARGET)/vboxdrv-src-1.dep \
758
759 # Scripts needed for building the kernel modules
760 includedep $(PATH_TARGET)/vboxdrv-src-1.dep
761 $$(vboxdrv-src_0_OUTDIR)/Makefile: \
762 $(PATH_SUB_CURRENT)/$(KBUILD_TARGET)/Makefile \
763 $$(if $$(eq $$(Support/$(KBUILD_TARGET)/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
764 | $$(dir $$@)
765 $(call MSG_TOOL,Creating,,$@)
766 $(QUIET)$(SED) -e "" \
767 $(if-expr !defined(VBOX_WITH_HARDENING) ,-e "s;VBOX_WITH_HARDENING;;g",) \
768 $(if-expr ($(VBOX_VERSION_BUILD) % 2) == 0 \
769 , -e "s;VBOX_WITH_EFLAGS_AC_SET_IN_VBOXDRV;;g" -e "s;IPRT_WITH_EFLAGS_AC_PRESERVING;;g",) \
770 --output $@ $<
771 %$(QUIET2)$(APPEND) -t '$(PATH_TARGET)/vboxdrv-src-1.dep' \
772 'Support/$(KBUILD_TARGET)/Makefile_VBOX_HARDENED=$(VBOX_WITH_HARDENING)'
773
774 #
775 # Build test for the linux host kernel modules.
776 #
777 $(evalcall2 VBOX_LINUX_KMOD_TEST_BUILD_RULE_FN,vboxdrv-src,,save_symvers)
778endif # linux freebsd
779
780
781ifeq ($(KBUILD_TARGET), win)
782 INSTALLS.win += VBoxDrv-inf
783 VBoxDrv-inf_TEMPLATE = VBoxR0DrvInfCat
784 VBoxDrv-inf_SOURCES = \
785 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf
786 VBoxDrv-inf_CLEAN = $(VBoxDrv-inf_SOURCES)
787 VBoxDrv-inf_BLDDIRS = $(PATH_TARGET)/VBoxDrvCat.dir
788
789 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf: $(PATH_SUB_CURRENT)/win/VBoxDrv.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
790 $(call MSG_GENERATE,VBoxDrv-inf,$@,$<)
791 $(call VBOX_EDIT_INF_FN,$<,$@)
792
793 ifdef VBOX_SIGNING_MODE
794 VBoxDrv-inf_SOURCES += \
795 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys \
796 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat \
797 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat=>VBoxDrv-PreW10.cat
798
799 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys: $$(VBoxDrv_1_TARGET) | $$(dir $$@)
800 $(INSTALL) -m 644 $< $(@D)
801
802 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.cat: \
803 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.inf \
804 $(PATH_TARGET)/VBoxDrvCat.dir/VBoxDrv.sys
805 $(call MSG_TOOL,Inf2Cat,VBoxDrv-inf,$@,$<)
806 $(call VBOX_MAKE_CAT_FN, $(@D),$@)
807 endif # signing
808endif # win
809
810
811endif # !VBOX_ONLY_DOCS && !VBOX_ONLY_EXTPACKS && !VBOX_ONLY_VALIDATIONKIT
812include $(FILE_KBUILD_SUB_FOOTER)
813
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette