forked from JamesHallowell/launchpad-pro-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
66 lines (56 loc) · 1.75 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
56
57
58
59
60
61
62
63
64
65
[env]
LAUNCHPAD_TARGET = "thumbv7m-none-eabi"
HOST_CPP = "g++"
BUILD_DIR = "build"
TOOLS_DIR = "tools"
OUTPUT = "app"
[tasks.build]
command = "cargo"
args = ["build", "--target", "${LAUNCHPAD_TARGET}"]
dependencies = [
{ name = "resources", path = "resources.toml" }
]
[tasks.build-release]
command = "cargo"
args = ["build", "--target", "${LAUNCHPAD_TARGET}", "--release"]
#
# SysEx Flow
#
[tasks.clean-build-dir]
private = true
description = "Remove the build directory."
command = "rm"
args = ["-rf", "${BUILD_DIR}"]
[tasks.make-build-dir]
private = true
description = "Make the build directory."
command = "mkdir"
args = ["-p", "${BUILD_DIR}"]
dependencies = ["clean-build-dir"]
[tasks.convert-to-hex]
private = true
install_crate = "cargo-binutils"
description = "Convert the binary into hex."
command = "cargo"
args = ["objcopy", "${@}", "--target", "${LAUNCHPAD_TARGET}", "--release", "--", "-O", "ihex", "${BUILD_DIR}/${OUTPUT}.hex"]
dependencies = ["make-build-dir"]
[tasks.build-hex-to-sysex-tool]
private = true
description = "Build dvhdr's tool for converting .hex to .syx."
command = "${HOST_CPP}"
args = ["-Ofast", "-std=c++0x", "-I${TOOLS_DIR}/libintelhex/include", "${TOOLS_DIR}/libintelhex/src/intelhex.cc", "${TOOLS_DIR}/hextosyx.cpp", "-o", "${BUILD_DIR}/hextosysex"]
[tasks.convert-to-sysex]
private = true
description = "Convert a .hex to a .syx using the hextosysex tool."
command = "build/hextosysex"
args = ["${BUILD_DIR}/${OUTPUT}.hex", "${BUILD_DIR}/${OUTPUT}.syx"]
dependencies = ["convert-to-hex", "build-hex-to-sysex-tool"]
[tasks.sysex]
description = "Convert to SysEx ready for uploading to Launchpad Pro."
dependencies = [
"clean-build-dir",
"make-build-dir",
"convert-to-hex",
"build-hex-to-sysex-tool",
"convert-to-sysex"
]