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