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