This is a Python reimplementation of the Jam build system (link).
Supported platforms: Linux (Unix), OpenVMS, Windows (ninja 1.14), MacOS
Jam is a build system (similar to meson, cmake, etc.). The key difference is that its core is essentially an interpreter for its internal language, with all building functionality written in this language.
The raw Jam language doesn't know how to build anything by itself, but it allows you to define rules and dependencies which construct the actual command sequence to build projects using a dependency tree.
Jam includes Jambase, which is a collection of generic rules to build C, C++ and
Fortran projects. It can be easily extended (or modified)
to support other types of projects.
- Uses
ninja,samuraior otherninja-compatible builders for the actual building of executables. mkdiris a built-in command that collects all created directories to thedirstarget.- Built-in rules are case-insensitive (
EchoandECHOare the same). - Regular expressions are Python-based.
Cleanactions are ignored in favor ofninja -t clean.
Install:
# Using uv (easiest and recommmended) from PyPI
uv tool install jam-build@latest
# Install jamp with the system pip
pip3 install jam-build
# Or from the latest main branch.
pip3 install git+https://github.com/ildus/jamp
# Using pypy3 provides approximately twice the performance
# pypy3 -m pip install jam-build
Install ninja using your package manager
dnf install ninja
# or pacman -Syu ninja
# etc.
Example project structure with a library and a main executable that uses math functions:
src
main.c
lib
print.c
include
common.h
Jamfile
Corresponding Jamfile:
HDRS = include ; # common includes, affects all sources
Library libprint : lib/print.c ; # on Unix this will create libprint.a
Main app : src/main.c ; # executable
LinkLibraries app : libprint ; # linking the executable with our library
LINKLIBS on app = -lm ; # extra libraries using paths
To build the executable, simply run:
jamp && ninja
For more complex examples, look at the tests directory. When dealing with subdirectories,
it's recommended to use the SubDir rule. Note that this example will not work on VMS.
git clone git@github.com:ildus/jamp.git
# To run without installing
export PYTHONPATH=$PYTHONPATH:<current_dir>/jamp/src
python3 -m jamp
# Testing changes
pip install pytest
cd <jamp root folder>
pytest
See the docs directory.
Use my github.com/ildus/samurai fork for compilation. It supports the additional '$^' escape
sequence for newlines, allowing you to add full scripts to build.ninja.