File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5- RELEASE_DIR=./release
5+ SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
6+
7+ RELEASE_DIR=${SCRIPT_DIR} /release
68
79mkdir -p ${RELEASE_DIR}
810
@@ -11,15 +13,15 @@ for TARGET_ARCH in thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi; do
1113 echo " TARGET is ${TARGET_ARCH} "
1214 for BINARY in flash0002 flash0802 flash1002; do
1315 echo " BINARY is ${BINARY} "
14- cargo build $* --release --target=${TARGET_ARCH} --bin ${BINARY}
16+ ( cd ${SCRIPT_DIR} && cargo build $* --release --target=${TARGET_ARCH} --bin ${BINARY} )
1517 # objcopy would do the build for us first, but it doesn't have good build output
16- rust-objcopy -O binary . /target/${TARGET_ARCH} /release/${BINARY} ${RELEASE_DIR} /${TARGET_ARCH} -${BINARY} -libneotron_os.bin
18+ rust-objcopy -O binary ${SCRIPT_DIR} /target/${TARGET_ARCH} /release/${BINARY} ${RELEASE_DIR} /${TARGET_ARCH} -${BINARY} -libneotron_os.bin
1719 # Keep the ELF file too (for debugging)
18- cp . /target/${TARGET_ARCH} /release/${BINARY} ${RELEASE_DIR} /${TARGET_ARCH} -${BINARY} -libneotron_os.elf
20+ cp ${SCRIPT_DIR} /target/${TARGET_ARCH} /release/${BINARY} ${RELEASE_DIR} /${TARGET_ARCH} -${BINARY} -libneotron_os.elf
1921 done
2022done
2123
2224# Build the host version
2325echo " Building HOST"
24- cargo build --verbose --lib --release --target=x86_64-unknown-linux-gnu
25- cp . /target/x86_64-unknown-linux-gnu/release/libneotron_os.so ${RELEASE_DIR} /x86_64-unknown-linux-gnu-libneotron_os.so
26+ ( cd ${SCRIPT_DIR} && cargo build --verbose --lib --release --target=x86_64-unknown-linux-gnu )
27+ cp ${SCRIPT_DIR} /target/x86_64-unknown-linux-gnu/release/libneotron_os.so ${RELEASE_DIR} /x86_64-unknown-linux-gnu-libneotron_os.so
You can’t perform that action at this time.
0 commit comments