Skip to content

Commit

Permalink
toolchains: Optionally build riscv-openocd with a separate script
Browse files Browse the repository at this point in the history
  • Loading branch information
a0u committed Oct 2, 2019
1 parent 2f1e5e9 commit b4ed5eb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
[submodule "toolchains/riscv-tools/riscv-tests"]
path = toolchains/riscv-tools/riscv-tests
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"]
path = vlsi/hammer
url = https://github.com/ucb-bar/hammer.git
Expand Down
24 changes: 24 additions & 0 deletions scripts/build-openocd.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions toolchains/riscv-tools/riscv-openocd
Submodule riscv-openocd added at 7c82a7

0 comments on commit b4ed5eb

Please sign in to comment.