PyMakeX
A Python-powered build system for MCU firmware development, built on top of SCons. Compile C/C++ source code for arm riscv, and other common microcontrollers with ease.
Features
- Multi-Toolchain Support — Use armgcc, LLVM/Clang, or armclang to compile your firmware.
- Modular Third-Party Integration — Pre-built modules for FreeRTOS, LVGL, FatFS, EasyLogger, CherryUSB, FreeModbus, and more.
- Incremental Builds — Analyzes which files need rebuilding and compiles only what changed.
- Multi-Processing Build — Parallel compilation with configurable job count (
-j). - Ninja Backend — Optional Ninja build mode for faster builds (
-nor--ninja). - Compilation Database — Generate
compile_commands.jsonfor IDE support and static analysis (--compiledb). - Build Cache — Cache compiled objects to speed up rebuilds (
--cache). - Dry-Run Mode — Preview what would be built without actually compiling (
--dry-run). - Party System — Organize third-party library flags and configurations in reusable "party" modules.
Installation
pip install pymakex
For development dependencies:
pip install pymakex[dev]
Quick Start
- Create a
Makefile.pyin your project root:
import pymakex
# Define your toolchain
pymakex.Toolchain("armgcc")
# Add your source files
pymakex.Sources([
"src/main.c",
"src/gpio.c",
"src/uart.c",
])
# Include third-party libraries via parties
pymakex.Party("FreeRTOS")
pymakex.Party("LVGL")
pymakex.Party("FatFS")
# Build the firmware
pymakex.Program("firmware.elf")
- Run the build:
pymakex -f Makefile.py
CLI Usage
pymakex [options]
Options:
-f, --file FILE Build script to execute (default: Makefile.py)
-j, --jobs N Number of parallel jobs (default: 1)
-m, --mode MODE Build mode: ninja | build | compiledb | cache | dryrun
-n, --ninja [update] Use Ninja build backend
-c, --clean Clean all build artifacts
--compiledb Generate compile_commands.json
--cache [update] Enable build cache
--dry-run Preview build without executing
-s, --silent Suppress non-error output
--verbose Show detailed build information
-l, --logger LEVEL Log level: 0=quiet, 1=verbose, 2=debug
-t, --toml PATH Specify TOML configuration file
-p, --party PATH Specify party file path
-v, --version Show version
Aliases
The following commands are equivalent:
pymake -f Makefile.py
pymakex -f Makefile.py
pymkx -f Makefile.py
Supported Toolchains
| Toolchain | Description |
|---|---|
armgcc |
ARM GNU GCC Toolchain |
llvm_clang |
LLVM/Clang for ARM |
armclang |
ARM Compiler 6 (armclang) |
Supported Third-Party Libraries (Parties)
| Module | Description |
|---|---|
FreeRTOS |
Real-time operating system |
LVGL |
Lightweight graphics library |
FatFS |
FAT/exFAT file system |
EasyLogger |
Embedded logging library |
CherryUSB |
USB device/host stack |
FreeModbus |
Modbus protocol stack |
FreeLWIP |
Lightweight TCP/IP stack |
HALDrivers |
MCU HAL drivers |
STDDrivers |
Standard peripheral drivers |
Build Workflow
- PyMakeX runs your
Makefile.pyscript in a subprocess. - The script defines parties, sources, targets, and build commands.
- Output marked with
##PYMAKE##is captured to build the task graph. - The task graph is analyzed to determine which files need rebuilding.
- Builds are executed in parallel (when
-j > 1).
License
MIT License — see the LICENSE file for details.
Metadata
Release files for PyMakeX 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pymakex-0.5.3-py3-none-any.whl | Python 3 | none | any | Details for pymakex-0.5.3-py3-none-any.whl |
Release files / pymakex-0.5.3-py3-none-any.whl
| Download URL | pymakex-0.5.3-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d997cbd58c5fae9d47079fbea433add2637ee1271aaee9f11b7e57ad4fac708
|
|
BLAKE2b-256 checksum How to use checksums |
f5cd9de0a40e0c9273457565249f1730dcd6305cd6e1a6ab42c302a75b444277
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Security for PyMakeX 0.5.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.