VirtualBox

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

Last change on this file since 91684 was 91677, checked in by vboxsync, 3 years ago

SUP/SpcRoot-MicrosoftTestingRootCertificateAuthority2010-8a334aa8052dd244a647306a76b8178fa215f344.taf: Added the 2010 testing root certificate.

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