-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·42 lines (34 loc) · 1.27 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2022 Avinal Kumar <[email protected]>
echo "Installing build dependencies"
DISTRO_NAME=$(lsb_release --id --short)
case "$DISTRO_NAME" in
Debian|Ubuntu)
echo "Installing dependencies for Debian-like distros..."
sudo apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& sudo apt-get -y install gcc g++ cmake git ninja-build make gcc-arm-none-eabi build-essential
;;
Fedora)
echo "Installing dependencies for Fedora..."
sudo dnf install -y gcc g++ cmake git ninja-build make \
gcc-arm-linux-gnu arm-none-eabi-gcc-cs-c++ arm-none-eabi-gcc-cs \
arm-none-eabi-binutils arm-none-eabi-newlib
;;
*) echo "Distro is not recognized, build dependencies won't be installed!!!"
esac
echo "Fetching the submodules..."
git submodule update --init
git submodule foreach git submodule update --init
echo "Creating build directory"
if [ ! -d "build" ]
then
mkdir build
else
echo "build directory exists..."
fi
cd build
echo "Generating CMake project..."
# using ninja for faster build
cmake .. -DPICO_BOARD=pimoroni_badger2040 -GNinja
echo "Bootstrap complete. Please goto build directory and run ninja to compile."