VirtualBox

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

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

RTSignTool,SUPR3: Implemented dev id / kext checks for verify-exe. bugref:9232

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