toolchains: Optionally build riscv-openocd with a separate script

This commit is contained in:
Albert Ou
2019-09-24 03:58:19 -07:00
parent 2f1e5e994b
commit b4ed5eb61b
3 changed files with 28 additions and 0 deletions

3
.gitmodules vendored
View File

@@ -50,6 +50,9 @@
[submodule "toolchains/riscv-tools/riscv-tests"] [submodule "toolchains/riscv-tools/riscv-tests"]
path = toolchains/riscv-tools/riscv-tests path = toolchains/riscv-tools/riscv-tests
url = https://github.com/riscv/riscv-tests.git url = https://github.com/riscv/riscv-tests.git
[submodule "toolchains/riscv-tools/riscv-openocd"]
path = toolchains/riscv-tools/riscv-openocd
url = https://github.com/riscv/riscv-openocd.git
[submodule "vlsi/hammer"] [submodule "vlsi/hammer"]
path = vlsi/hammer path = vlsi/hammer
url = https://github.com/ucb-bar/hammer.git url = https://github.com/ucb-bar/hammer.git

24
scripts/build-openocd.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# exit script if any command fails
set -e
set -o pipefail
RDIR=$(git rev-parse --show-toplevel)
if [ -z "${RISCV}" ] ; then
! [ -r "${RDIR}/env.sh" ] || . "${RDIR}/env.sh"
if [ -z "${RISCV}" ] ; then
echo "${0}: set the RISCV environment variable to desired install path"
exit 1
fi
fi
SRCDIR="${RDIR}/toolchains/riscv-tools"
. "${RDIR}/scripts/build-util.sh"
git config --unset submodule.toolchains/riscv-tools/riscv-openocd.update || :
module_prepare riscv-openocd
module_run riscv-openocd ./bootstrap
module_build riscv-openocd --prefix="${RISCV}" \
--enable-remote-bitbang --enable-jtag_vpi --disable-werror