Skip to main content

Jam Build System (based on Python)

Project description

Jam build system on Python

This is a Python reimplementation of the Jam build system (link).

Supported platforms: Linux (Unix), OpenVMS, Windows (WIP), MacOS (WIP)

What is Jam

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.

Differences from the original Jam

  • Uses ninja, samurai or other ninja-compatible builders for the actual building of executables.
  • mkdir is a built-in command that collects all created directories to the dirs target.
  • Built-in rules are case-insensitive (Echo and ECHO are the same).
  • Regular expressions are Python-based.
  • Clean actions are ignored in favor of ninja -t clean.

Quick Start

Install:

# 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 ;             # system libraries

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 should work on Windows and Linux (because of explicit paths), but will not work on VMS.

Contributing

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

Documentation

See the docs directory.

OpenVMS Notes

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jam_build-0.6.4.tar.gz (120.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jam_build-0.6.4-py3-none-any.whl (80.3 kB view details)

Uploaded Python 3

File details

Details for the file jam_build-0.6.4.tar.gz.

File metadata

  • Download URL: jam_build-0.6.4.tar.gz
  • Upload date:
  • Size: 120.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jam_build-0.6.4.tar.gz
Algorithm Hash digest
SHA256 11a3b117b1fdce411fe8575c2956fd1e4287201e3619f3fc779f311b0bba5ea3
MD5 f2e500148f397bea5a0c9f8977a7874a
BLAKE2b-256 738ec6acdf03b0c4de5e51bc1ebdf97a38c7029b8fd5294efd1151f9ed0b3877

See more details on using hashes here.

Provenance

The following attestation bundles were made for jam_build-0.6.4.tar.gz:

Publisher: pypi.yml on ildus/jamp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jam_build-0.6.4-py3-none-any.whl.

File metadata

  • Download URL: jam_build-0.6.4-py3-none-any.whl
  • Upload date:
  • Size: 80.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jam_build-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3928f596cbca36d4ab4144eb9b8c4855f22f8047f39ba170aee880113e36b3b0
MD5 1b2afddc07182b89fad4bfce417c0fc4
BLAKE2b-256 34b6b9045c3d21f4564278e6ebb5b418ea58c3e3ca8c70a203fffd0a98046dc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for jam_build-0.6.4-py3-none-any.whl:

Publisher: pypi.yml on ildus/jamp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page