File tree Expand file tree Collapse file tree 3 files changed +37
-6
lines changed
Expand file tree Collapse file tree 3 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ TARGET=${1:- thumbv6m-none-eabi}
6+
7+ if [ " $TARGET " == " thumbv6m-none-eabi" ]; then
8+ CPU=" cortex-m0plus"
9+ elif [ " $TARGET " == " thumbv7m-none-eabi" ]; then
10+ CPU=" cortex-m3"
11+ elif [ " $TARGET " == " thumbv7em-none-eabi" ]; then
12+ CPU=" cortex-m4"
13+ else
14+ echo " Unknown target"
15+ exit 1
16+ fi
17+
218arm-none-eabi-gcc \
319 -nostartfiles \
420 -ffreestanding \
5- -mcpu=cortex-m0plus \
21+ -mcpu=$CPU \
622 -Wl,-T../neotron-cortex-m.ld \
723 -o asmhello.elf \
824 asmhello.S \
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ echo "Building for ${TARGET}"
2525cargo build --target ${TARGET} --release
2626
2727pushd chello
28- ./build.sh
28+ ./build.sh ${TARGET}
2929popd
3030
3131pushd asmhello
32- ./build.sh
32+ ./build.sh ${TARGET}
3333popd
3434
3535for program in panic hello fault input-test; do
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ TARGET=${1:- thumbv6m-none-eabi}
6+
7+ if [ " $TARGET " == " thumbv6m-none-eabi" ]; then
8+ CPU=" cortex-m0plus"
9+ elif [ " $TARGET " == " thumbv7m-none-eabi" ]; then
10+ CPU=" cortex-m3"
11+ elif [ " $TARGET " == " thumbv7em-none-eabi" ]; then
12+ CPU=" cortex-m4"
13+ else
14+ echo " Unknown target"
15+ exit 1
16+ fi
217
318arm-none-eabi-gcc \
419 -fdata-sections \
520 -ffreestanding \
621 -ffunction-sections \
722 -flto \
8- -mcpu=cortex-m0 \
23+ -mcpu=$CPU \
924 -nostartfiles \
1025 -Os \
1126 -Wall \
You can’t perform that action at this time.
0 commit comments