Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
David Lattimore | 3b6faa2 | 2022-10-18 14:10:43 +1100 | [diff] [blame] | 3 | # Copyright 2021 The ChromiumOS Authors |
Alan Green | 7c5639e | 2021-05-05 17:10:41 +1000 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 7 | if [ "${BASH_SOURCE-}" = "$0" ]; then |
| 8 | echo -e "This script should be sourced, not run:\nsource $0" >&2 |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | # Exports environment variables needed by parts of this project. |
| 13 | |
Alan Green | 397c934 | 2021-05-06 07:11:48 +1000 | [diff] [blame] | 14 | HPS_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 15 | |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 16 | # We completely overwrite any existing PATH. This ensures that we're not getting |
| 17 | # things from unexpected places. |
Dan Callaghan | 7437383 | 2022-08-22 16:04:32 +1000 | [diff] [blame] | 18 | PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
Dan Callaghan | f1261f2 | 2022-05-27 15:01:52 +1000 | [diff] [blame] | 19 | PATH="/opt/hps-sdk/bin:${PATH}" |
Alan Green | 967106d | 2022-01-24 09:01:19 +1100 | [diff] [blame] | 20 | PATH="${HPS_ROOT}/scripts:${PATH}" |
Alan Green | 397c934 | 2021-05-06 07:11:48 +1000 | [diff] [blame] | 21 | export PATH |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 22 | |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 23 | # This speeds up recompilation of verilator generated code quit a bit. |
| 24 | export OBJCACHE=ccache |
| 25 | export CC="ccache gcc" |
| 26 | |
Alan Green | 9b7a93d | 2021-03-11 14:24:52 +1100 | [diff] [blame] | 27 | for i in "${HPS_ROOT}/third_party/python"/*; do |
| 28 | PYTHONPATH="${PYTHONPATH}:${i}" |
| 29 | done |
| 30 | export PYTHONPATH |
| 31 | |
Alan Green | 397c934 | 2021-05-06 07:11:48 +1000 | [diff] [blame] | 32 | # List of directories with Rust source |
| 33 | export HPS_RUST_DIRS=( |
David Lattimore | 28a3381 | 2021-11-17 09:26:31 +1100 | [diff] [blame] | 34 | rust |
David Lattimore | 417ea75 | 2021-11-17 10:26:52 +1100 | [diff] [blame] | 35 | rust/mcu |
David Lattimore | 28a3381 | 2021-11-17 09:26:31 +1100 | [diff] [blame] | 36 | rust/riscv |
David Lattimore | d544c7b | 2021-04-07 08:36:34 +1000 | [diff] [blame] | 37 | ) |