VirtualBox

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

Last change on this file since 87593 was 87233, checked in by vboxsync, 4 years ago

SUP: Adjustments for bugref:9898.

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