Skip to main content

Simple JSON-based CLI build tool for C!!!

Project description

r3make

PyPi Package version

r3make is a minimal, fast, and readable JSON-based build tool for C projects. It handles basic compilation and linking tasks with zero setup complexity, making it ideal for small-to-medium codebases that don't need the overhead of tools like CMake.


Features

  • Straightforward JSON Config – All build logic lives in a clean, intuitive JSON file.
  • Multi-Target Support – Define any number of build targets in a single file.
  • Flexible Output – Supports building executables, shared libraries, and static libraries.
  • Cross-Compiler – Works with GCC, Clang, Emscripten, and MSVC.
  • Cross-Platform (Work in Progress) – Windows is fully supported, with Linux and macOS planned.
  • Optional --run Flag – Automatically run the built executable target after compilation.

Getting Started

1. Create a r3make.json file in your project root

A minimal example utilizing all config fields:

{
    "MyApp": {
        "defines": ["MYAPP_BUILD"],
        "flags": ["-Wall", "-Werror", "-std=c99"],

        "includes": ["include"],
        "sources": ["src/*.c"],
        
        "libraries": {"gdi32": null, "SSDK": null},
        "gitdeps": ["r3shape/SSDK"],

        "name": "App",
        "type": "exe",
        "dest": "bin"
    }
}

Building a Project

Run this from the directory containing r3make.json:

r3make --target MyApp

To run an executable immediately after building:

r3make --target MyApp --run

Target Configuration Fields

Field Required Description
sources Yes List of glob patterns or file paths to .c files.
type Yes exe, dll, or lib (shared/static libraries).
dest Yes Output directory for built files.
flags No Additional compiler flags.
defines No List of preprocessor defines.
gitdeps No List of remote linked libraries.
includes No List of include directories.
libraries No Linked libraries, optionally with paths.

CLI Flags

Short Flag Long Flag Description
-t --target Name of the target to build (e.g., -t MyApp). Required unless defaulting.
-v --verbose Enables verbose output (shows full commands and file list).
-f --file Path to the r3make.json config file (defaults to r3make.json in current dir).
-nf --nofiles Disables file discovery; skips glob expansion (useful for debugging).
-be --buildeach Forces compilation of all sources individually, even if a library.
-r --run Runs the target after a successful build (only works for exe targets).

Installation

Install via pip:

pip install r3make

Why r3make?

CMake and Make are powerful but overly complex for many use cases. r3make gives you:

  • A single clean JSON file.
  • No scripts or Makefile DSL.
  • Easier cross-compilation setup.
  • Simpler onboarding for contributors.

Roadmap

  • Incremental builds (skip unchanged files).
  • Parallel compilation.
  • Better error messages and diagnostics.
  • Linux/macOS support.
  • [✔️] Remote dependency fetching (gitdeps config field).

Contributing

Issues and pull requests are welcome! If you find a bug, want to suggest a feature, or improve documentation, visit github.com/r3shape/r3make.


License

MIT License. See LICENSE.

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

r3make-2025.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

r3make-2025.2.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file r3make-2025.2.0.tar.gz.

File metadata

  • Download URL: r3make-2025.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for r3make-2025.2.0.tar.gz
Algorithm Hash digest
SHA256 be30b9ae13e301e614c473e5862deaf0124b58a0156c43529d93b20978e34e80
MD5 3dbe07db833ff695cf76264d755a357e
BLAKE2b-256 c79ad5adffb1c42fb23baa63f1366b83d8be8f3e2777d9ba3c5a680430acd214

See more details on using hashes here.

File details

Details for the file r3make-2025.2.0-py3-none-any.whl.

File metadata

  • Download URL: r3make-2025.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for r3make-2025.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40c7623f6f22c7f68a09ec9996d4593dd4e3026c500ed96b30d1e227b5dec304
MD5 9dccd1fdfe8f975de3b853f8415b4df6
BLAKE2b-256 f6081f74fea90d8dcf1bbdb9f954c831437c2cd1c82887c5b16b475287fb447c

See more details on using hashes here.

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