diff --git a/.circleci/config.yml b/.circleci/config.yml index b6556850..88a20f24 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ version: 2.1 parameters: tools-cache-version: type: string - default: "v5" + default: "v6" # default execution env.s executors: diff --git a/scripts/build-toolchains.sh b/scripts/build-toolchains.sh index 62a2f74b..2685872e 100755 --- a/scripts/build-toolchains.sh +++ b/scripts/build-toolchains.sh @@ -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" <> 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!" diff --git a/scripts/build-util.sh b/scripts/build-util.sh index 10a7cb7b..892b274d 100644 --- a/scripts/build-util.sh +++ b/scripts/build-util.sh @@ -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 diff --git a/scripts/init-submodules-no-riscv-tools-nolog.sh b/scripts/init-submodules-no-riscv-tools-nolog.sh index d91e89b9..cede5e47 100755 --- a/scripts/init-submodules-no-riscv-tools-nolog.sh +++ b/scripts/init-submodules-no-riscv-tools-nolog.sh @@ -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