-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile.toml
37 lines (29 loc) · 938 Bytes
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[env]
VC_BUILD_DIR="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
[env.development]
TARGET_PATH = "target/debug"
[env.production]
TARGET_PATH = "target/release"
BUILD_RELEASE = "--release"
[tasks.clean-cert]
script = '''
# Remove the self-signed certificate.
if exist DriverCertificate.cer ( rm DriverCertificate.cer )
'''
[tasks.build-driver]
script = '''
cargo b %BUILD_FLAGS%
'''
[tasks.rename]
ignore_errors = true
script = '''
cd %TARGET_PATH%
rename driver.dll driver.sys
'''
[tasks.sign]
dependencies = ["build-driver", "rename"]
script = '''
call "%VC_BUILD_DIR%"
if not exist DriverCertificate.cer ( makecert -r -pe -ss PrivateCertStore -n CN=DriverCertificate DriverCertificate.cer ) else ( echo Certificate already exists. )
signtool sign /a /v /s PrivateCertStore /n DriverCertificate /fd certHash /t http://timestamp.digicert.com %TARGET_PATH%/driver.sys
'''