VirtualBox

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

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

IPRT,SUP,Main: Working on new crypto key handling and rsa signing. bugref:9152

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