This document describes how to set up your environment, configure your toolchain, and build TinyGCalc for various platforms.
- CMake 3.13 or later
- Git (with submodule support)
- SDL2 (for mock platform)
- A C compiler:
- Windows: MinGW-w64
- Linux/macOS: GCC/Clang
picotool(optional but recommended, see below)
Make sure to clone with submodules:
git clone --recursive https://github.com/ApexDevelopment/TinyGCalc.git
cd TinyGCalcIf you forgot --recursive, you can run:
git submodule update --init --recursiveTinyGCalc supports multiple platforms. Use the build script to select a target:
./build [platform] # Linux/macOS/WSL
build.bat [platform] # WindowsSupported platforms:
mock(default): Desktop SDL2 buildpico: Raspberry Pi Pico (RP2040)picow: Raspberry Pi Pico W (RP2040 + Wi-Fi)stm32: Experimental; build system is present but the platform is not yet functional
build clean– removes all platform build directoriesbuild [platform] clean– cleans only that platform’s build directory
If you're building for a Pico target, installing picotool is strongly recommended.
-
Clone and build it:
git clone --recursive https://github.com/raspberrypi/picotool.git cd picotool mkdir build && cd build cmake -G "MinGW Makefiles" .. # or use Ninja if preferred mingw32-make # or make / ninja
-
Copy the binary to a folder in your
PATH(e.g.,C:\Tools\picotool.exe)
-
Clone and build it:
git clone --recursive https://github.com/raspberrypi/picotool.git cd picotool mkdir build && cd build cmake .. make sudo make install # Optional, installs to /usr/local/bin
This allows TinyGCalc to skip rebuilding the SDK’s bundled picotool every time you run a clean build.
Some versions of pico-sdk (as a submodule) include a bundled copy of mbedtls with a deprecated cmake_minimum_required() directive in its CMakeLists.txt. This can cause CMake configuration to fail with unclear errors during pico_sdk_init().
To fix this:
- Make sure your CMake is at least 3.13
- Open
pico-sdk/lib/mbedtls/CMakeLists.txt - Locate the
cmake_minimum_required(...)line near the top - Manually update it to
cmake_minimum_required(VERSION 3.13)or higher
Once patched, re-run your build.
Alternatively, installing picotool globally (see above) avoids this issue entirely by disabling the SDK's internal picotool build.
If you hit something unexpected, open an issue!