Compile on WSL with ninja - portapack-mayhem/mayhem-firmware GitHub Wiki
[!NOTE]
ccache is default disabled because it creats issues in particular situation.
If you are aware its pros and cons and you insist enable it, following this guide: https://github.com/portapack-mayhem/mayhem-firmware/wiki/Notes-About-ccache
If you don't know what's this, just use default.
- Update your system:
sudo apt-get update
sudo apt-get upgrade
- Install dependencies:
sudo apt-get install -y git tar wget dfu-util cmake python3 ccache bzip2 liblz4-tool curl ninja-build python3-pip
- Install pip and pyyaml:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py --break-system-packages
sudo python3 get-pip.py
pip install pyyaml --break-system-packages
- Set up environment variables:
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
- Download and install the ARM toolchain:
mkdir -p /opt/build
cd /opt/build
wget -O gcc-arm-none-eabi.tar.bz2 "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2?revision=108bd959-44bd-4619-9c19-26187abf5225&la=en&hash=E788CE92E5DFD64B2A8C246BBA91A249CB8E2D2D"
sudo mkdir armbin
sudo tar --strip=1 -xjvf gcc-arm-none-eabi.tar.bz2 -C armbin
- Add the ARM toolchain to your PATH:
echo 'export PATH=$PATH:/opt/build/armbin/bin' >> ~/.bashrc
source ~/.bashrc
- Clone the PortaPack Mayhem repository (if you haven't already):
sudo git clone --recurse-submodules https://github.com/portapack-mayhem/mayhem-firmware.git
cd mayhem-firmware
sudo chmod -R 777 ~/mayhem-firmware
- Create a build directory and run CMake:
mkdir build
cd build
cmake -G Ninja ..
- Build the firmware:
ninja