Merge pull request #649 from ucb-bar/dir-eval
Change DIR evaluation strategy
This commit is contained in:
@@ -6,7 +6,7 @@ version: 2.1
|
||||
parameters:
|
||||
tools-cache-version:
|
||||
type: string
|
||||
default: "v5"
|
||||
default: "v6"
|
||||
|
||||
# default execution env.s
|
||||
executors:
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
RDIR=$(pwd)
|
||||
CHIPYARD_DIR="${CHIPYARD_DIR:-$(git rev-parse --show-toplevel)}"
|
||||
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
CHIPYARD_DIR="$(dirname "$DIR")"
|
||||
|
||||
usage() {
|
||||
echo "usage: ${0} [OPTIONS] [riscv-tools | esp-tools | ec2fast]"
|
||||
@@ -134,18 +134,16 @@ SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=ris
|
||||
git submodule update --init $CHIPYARD_DIR/tools/dromajo/dromajo-src
|
||||
make -C $CHIPYARD_DIR/tools/dromajo/dromajo-src/src
|
||||
|
||||
cd "$RDIR"
|
||||
|
||||
# create specific env.sh
|
||||
{
|
||||
echo "# auto-generated by build-toolchains.sh"
|
||||
echo "export CHIPYARD_TOOLCHAIN_SOURCED=1"
|
||||
echo "export RISCV=$(printf '%q' "$RISCV")"
|
||||
echo "export PATH=\${RISCV}/bin:\${PATH}"
|
||||
echo "export LD_LIBRARY_PATH=\${RISCV}/lib\${LD_LIBRARY_PATH:+":\${LD_LIBRARY_PATH}"}"
|
||||
} > env-$TOOLCHAIN.sh
|
||||
cat > "$CHIPYARD_DIR/env-$TOOLCHAIN.sh" <<EOF
|
||||
# auto-generated by build-toolchains.sh
|
||||
export CHIPYARD_TOOLCHAIN_SOURCED=1
|
||||
export RISCV=$(printf '%q' "$RISCV")
|
||||
export PATH=\${RISCV}/bin:\${PATH}
|
||||
export LD_LIBRARY_PATH=\${RISCV}/lib\${LD_LIBRARY_PATH:+":\${LD_LIBRARY_PATH}"}
|
||||
EOF
|
||||
|
||||
# create general env.sh
|
||||
echo "# line auto-generated by build-toolchains.sh" >> env.sh
|
||||
echo "source \$( realpath \$(dirname "\${BASH_SOURCE[0]:-\${\(%\):-%x}}") )/env-$TOOLCHAIN.sh" >> env.sh
|
||||
echo "source $(printf '%q' "$CHIPYARD_DIR/env-$TOOLCHAIN.sh")" >> env.sh
|
||||
echo "Toolchain Build Complete!"
|
||||
|
||||
@@ -15,7 +15,7 @@ case ${ncpu} in
|
||||
esac
|
||||
|
||||
# Allow user to override MAKE
|
||||
[ -n "${MAKE}" ] || MAKE=$(command -v gnumake || command -v gmake || command -v make)
|
||||
[ -n "${MAKE:+x}" ] || MAKE=$(command -v gnumake || command -v gmake || command -v make)
|
||||
readonly MAKE
|
||||
|
||||
|
||||
|
||||
@@ -17,10 +17,11 @@ if [ "$MINGIT" != "$(echo -e "$MINGIT\n$MYGIT" | sort -V | head -n1)" ]; then
|
||||
false
|
||||
fi
|
||||
|
||||
RDIR=$(git rev-parse --show-toplevel)
|
||||
DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
||||
CHIPYARD_DIR="$(dirname "$DIR")"
|
||||
|
||||
# Ignore toolchain submodules
|
||||
cd "$RDIR"
|
||||
cd "$CHIPYARD_DIR"
|
||||
for name in toolchains/*-tools/*/ ; do
|
||||
git config submodule."${name%/}".update none
|
||||
done
|
||||
@@ -71,8 +72,11 @@ git config submodule.sims/firesim.update none
|
||||
git submodule update --init software/firemarshal
|
||||
|
||||
# Configure firemarshal to know where our firesim installation is
|
||||
if [ ! -f $RDIR/software/firemarshal/marshal-config.yaml ]; then
|
||||
echo "firesim-dir: '../../sims/firesim/'" > $RDIR/software/firemarshal/marshal-config.yaml
|
||||
if [ ! -f ./software/firemarshal/marshal-config.yaml ]; then
|
||||
echo "firesim-dir: '../../sims/firesim/'" > ./software/firemarshal/marshal-config.yaml
|
||||
fi
|
||||
echo "# line auto-generated by init-submodules-no-riscv-tools.sh" >> $RDIR/env.sh
|
||||
echo "PATH=\$( realpath \$(dirname "\${BASH_SOURCE[0]:-\${\(%\):-%x}}") )/software/firemarshal:\$PATH" >> $RDIR/env.sh
|
||||
|
||||
echo "# line auto-generated by init-submodules-no-riscv-tools.sh" >> env.sh
|
||||
echo '__DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"' >> env.sh
|
||||
echo "PATH=\$__DIR/bin:\$PATH" >> env.sh
|
||||
echo "PATH=\$__DIR/software/firemarshal:\$PATH" >> env.sh
|
||||
|
||||
Reference in New Issue
Block a user