1#!/usr/bin/env bash
2# Copyright 2018 Oticon A/S
3# SPDX-License-Identifier: Apache-2.0
4
5# Compile all the applications needed by the Bluetooth bsim tests
6
7#set -x #uncomment this line for debugging
8set -ue
9: "${BSIM_COMPONENTS_PATH:?BSIM_COMPONENTS_PATH must be defined}"
10: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root\
11 directory}"
12
13WORK_DIR="${WORK_DIR:-${ZEPHYR_BASE}/bsim_out}"
14
15BOARD_ROOT="${BOARD_ROOT:-${ZEPHYR_BASE}}"
16
17mkdir -p ${WORK_DIR}
18
19source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
20
21# Note: We do not parallelize the call into the build of the host, ll and mesh images as those
22# are already building many images in parallel in themselves, and otherwise we would be
23# launching too many parallel builds which can lead to a too high system load.
24# On the other hand the audio compile script, only builds one image. So we parallelize it with
25# the rest to save a couple of seconds.
26run_in_background ${ZEPHYR_BASE}/tests/bsim/bluetooth/audio/compile.sh
27${ZEPHYR_BASE}/tests/bsim/bluetooth/host/compile.sh
28${ZEPHYR_BASE}/tests/bsim/bluetooth/ll/compile.sh
29${ZEPHYR_BASE}/tests/bsim/bluetooth/mesh/compile.sh
30
31wait_for_background_jobs
32