blob: 831071d45d765444a148a6f7ef2006c5480b4e97 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
BUILD=build
NAME=
while getopts "d:o:" opt; do
case "$opt" in
d) BUILD="$OPTARG";;
o) NAME="$OPTARG";;
*) echo "unrecognised option -$OPTARG" >&2; exit 1;
esac
done
shift $((OPTIND - 1))
# might try to figure out how to support llvm as well in tests, but good enough
# for now
riscv64-unknown-elf-gcc -O2 -Wall -Wextra -ffreestanding -nostdlib \
-march=rv64i -mabi=lp64 -fno-delete-null-pointer-checks \
-o "${BUILD}/${NAME}.elf" "${@}"
riscv64-unknown-elf-objcopy -Obinary "${BUILD}/${NAME}.elf" "${BUILD}/${NAME}.bin"
xxd -i "${BUILD}/${NAME}.bin" > "${BUILD}/${NAME}"
|