-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathMakefile.toml
55 lines (45 loc) · 2.06 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[config]
skip_core_tasks = true
[env]
TARGET = "x86_64-pc-windows-gnu"
PIC_RUSTFLAGS = "-C link-arg=-nostdlib -C codegen-units=1 -C link-arg=-fno-ident -C link-arg=-fpack-struct=8 -C link-arg=-Wl,--gc-sections -C link-arg=-falign-jumps=1 -C link-arg=-w -C link-arg=-falign-labels=1 -C relocation-model=pic -C link-arg=-Wl,-T./Linker.ld,--build-id=none -C link-arg=-Wl,-s,--no-seh,--enable-stdcall-fixup -C link-arg=-Wl,--subsystem,console -C link-arg=-nostartfiles -C link-arg=-Wl,-e_start"
EXE_RUSTFLAGS = "-C link-arg=-nostdlib -C link-arg=-Wl,--gc-sections -C link-arg=-Wl,--subsystem,console -C link-arg=-nostartfiles -C link-arg=-Wl,-e_start"
FEATURES = ""
[tasks.default]
description = "Default task that builds the project."
dependencies = ["build"]
[tasks.build]
description = "Clean, Builds, strips, and objcopy."
dependencies = ["clean", "cargo-build", "strip"]
[tasks.clean]
description = "Cleans the project and removes the binary file."
script = [
"cargo clean"
]
[tasks.cargo-build]
description = "Build the project using cargo with custom rustflags."
command = "cargo"
args = ["build", "--release", "--target", "${TARGET}", "--features", "${FEATURES}"]
env = { "RUSTFLAGS" = "${EXE_RUSTFLAGS}" }
[tasks.strip]
description = "Strips unnecessary sections from the binary."
command = "strip"
args = ["-s", "--strip-unneeded", "-x", "-X", "target/x86_64-pc-windows-gnu/release/RustiveDump.exe"]
[tasks.pic]
description = "Builds with PIC enabled."
dependencies = ["cleanpic", "cargo-build-pic", "strip", "objcopy"]
[tasks.cleanpic]
description = "Cleans the project and removes the binary file."
script = [
"cargo clean",
"rm -f RustiveDump.bin"
]
[tasks.cargo-build-pic]
description = "Build the project using cargo with PIC enabled."
command = "cargo"
args = ["build", "--release", "--target", "${TARGET}", "--features", "${FEATURES}"]
env = { "RUSTFLAGS" = "${PIC_RUSTFLAGS}" }
[tasks.objcopy]
description = "Converts the binary to a .bin file using objcopy."
command = "objcopy"
args = ["-O", "binary", "target/x86_64-pc-windows-gnu/release/RustiveDump.exe", "RustiveDump.bin"]