blob: ed9ed614b3b1b8e924f8ca9adb207d35961cd2a8 [file] [log] [blame]
Alan Green9b7a93d2021-03-11 14:24:52 +11001#!/bin/bash
2
David Lattimore3b6faa22022-10-18 14:10:43 +11003# Copyright 2021 The ChromiumOS Authors
Alan Green7c5639e2021-05-05 17:10:41 +10004# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
Alan Green9b7a93d2021-03-11 14:24:52 +11007if [ "${BASH_SOURCE-}" = "$0" ]; then
8 echo -e "This script should be sourced, not run:\nsource $0" >&2
9 exit 1
10fi
11
12# Exports environment variables needed by parts of this project.
13
Alan Green397c9342021-05-06 07:11:48 +100014HPS_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
Alan Green9b7a93d2021-03-11 14:24:52 +110015
Alan Green9b7a93d2021-03-11 14:24:52 +110016# We completely overwrite any existing PATH. This ensures that we're not getting
17# things from unexpected places.
Dan Callaghan74373832022-08-22 16:04:32 +100018PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Dan Callaghanf1261f22022-05-27 15:01:52 +100019PATH="/opt/hps-sdk/bin:${PATH}"
Alan Green967106d2022-01-24 09:01:19 +110020PATH="${HPS_ROOT}/scripts:${PATH}"
Alan Green397c9342021-05-06 07:11:48 +100021export PATH
Alan Green9b7a93d2021-03-11 14:24:52 +110022
Alan Green9b7a93d2021-03-11 14:24:52 +110023# This speeds up recompilation of verilator generated code quit a bit.
24export OBJCACHE=ccache
25export CC="ccache gcc"
26
Alan Green9b7a93d2021-03-11 14:24:52 +110027for i in "${HPS_ROOT}/third_party/python"/*; do
28 PYTHONPATH="${PYTHONPATH}:${i}"
29done
30export PYTHONPATH
31
Alan Green397c9342021-05-06 07:11:48 +100032# List of directories with Rust source
33export HPS_RUST_DIRS=(
David Lattimore28a33812021-11-17 09:26:31 +110034 rust
David Lattimore417ea752021-11-17 10:26:52 +110035 rust/mcu
David Lattimore28a33812021-11-17 09:26:31 +110036 rust/riscv
David Lattimored544c7b2021-04-07 08:36:34 +100037)