Skip to content

Commit 24c84b0

Browse files
authored
Merge pull request #11 from flit/mac_build
build.sh working on macOS
2 parents bd9878d + f65ec2d commit 24c84b0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
set -euo pipefail
44

5+
# macOS base64 doesn't take -w argument and defaults to a single line.
6+
if [[ $(uname) = "Darwin" ]]; then
7+
BASE64_FLAGS=""
8+
else
9+
BASE64_FLAGS="-w0"
10+
fi
11+
512
cargo build --release
613
ELF=target/thumbv6m-none-eabi/release/flash-algo
714

@@ -10,7 +17,7 @@ rust-objdump -x $ELF > target/dump.txt
1017
rust-nm $ELF -n > target/nm.txt
1118

1219
function bin {
13-
rust-objcopy $ELF -O binary - | base64 -w0
20+
rust-objcopy $ELF -O binary - | base64 $BASE64_FLAGS
1421
}
1522

1623
function sym {

0 commit comments

Comments
 (0)