{"id":25781908,"url":"https://github.com/r3shape/r3make","last_synced_at":"2026-04-30T12:32:11.133Z","repository":{"id":264542845,"uuid":"893639724","full_name":"r3shape/r3make","owner":"r3shape","description":"A simple CLI build tool for C/C++.","archived":false,"fork":false,"pushed_at":"2025-08-29T19:05:00.000Z","size":72,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T06:15:43.730Z","etag":null,"topics":["build-tool","c99","cli","open-source"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/r3make/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r3shape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-24T23:50:29.000Z","updated_at":"2025-12-29T11:11:41.000Z","dependencies_parsed_at":"2025-04-12T23:21:09.854Z","dependency_job_id":"cb1e0696-56e5-43c1-a198-392cde94a12d","html_url":"https://github.com/r3shape/r3make","commit_stats":null,"previous_names":["d34d0s/cbuild","r3shape/cbuild","r3shape/r3make"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/r3shape/r3make","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3shape%2Fr3make","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3shape%2Fr3make/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3shape%2Fr3make/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3shape%2Fr3make/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r3shape","download_url":"https://codeload.github.com/r3shape/r3make/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r3shape%2Fr3make/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32465009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","c99","cli","open-source"],"created_at":"2025-02-27T07:33:18.534Z","updated_at":"2026-04-30T12:32:11.126Z","avatar_url":"https://github.com/r3shape.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# r3make\n\n![PyPi Package version](https://img.shields.io/pypi/v/r3make?style=for-the-badge\\\u0026logo=pypi\\\u0026logoColor=white\\\u0026label=r3make\\\u0026labelColor=black\\\u0026color=white)\n\n**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.\n\n---\n\n## Features\n\n* **Straightforward JSON Config** – All build logic lives in a clean, intuitive JSON file.\n* **Multi-Target Support** – Define any number of build targets in a single file.\n* **Flexible Output** – Supports building executables, shared libraries, and static libraries.\n* **Cross-Compiler** – Works with GCC, Clang, Emscripten, and MSVC.\n* **Cross-Platform (Work in Progress)** – Windows is fully supported, with Linux and macOS planned.\n* **Optional `--run` Flag** – Automatically run the built executable target after compilation.\n\n---\n\n## Why r3make?\n\nMakefile and CMake are powerful but overly complex for many use cases. `r3make` gives you:\n\n* A single clean JSON file.\n* No scripts or Makefile DSL.\n* Easier cross-compilation setup.\n* Simpler onboarding for contributors.\n\n---\n\n## Getting Started\n\n### 1. Create a `r3make.json` file in your project root\n\nA minimal example utilizing all config fields:\n\n```json\n{\n    \"MyApp\": {\n        \"defines\": [\"MYAPP_BUILD\"],\n        \"flags\": [\"-Wall\", \"-Werror\", \"-std=c99\"],\n\n        \"includes\": [\"include\"],\n        \"sources\": [\"src/*.c\"],\n        \n        \"libraries\": {\"gdi32\": null, \"SSDK\": null},\n        \"gitdeps\": [\"r3shape/SSDK\"],\n\n        \"name\": \"App\",\n        \"type\": \"exe\",\n        \"dest\": \"bin\"\n    }\n}\n```\n\n## Building a Project\n\nRun this from the directory containing `r3make.json`:\n\n```bash\nr3make --target MyApp\n```\n\nTo run an executable immediately after building:\n\n```bash\nr3make --target MyApp --run\n```\n| \u003cb\u003eNOTE:  \n| If the `name` field is not present in a r3make target, the target name is used.  \n| r3make configuration files may have a target named \"main\", this is the default target when calling `r3make` with no `--target` flag. \u003c/b\u003e\n\n---\n\n## Fetching Remote Libraries\nConsider the following program:\n\n```c\n#include \u003cinclude/SSDK/SSDK.h\u003e\n\nint main() {\n    ssdkInitLog();\n    saneLog-\u003elog(SANE_LOG_DUMP, \"Hello, World!\");\n    ssdkExitLog();\n    return 0;\n}\n```\n\nThe above code is using the [SSDK](https://github.com/r3shape/SSDK) library, but we have not installed [SSDK](https://github.com/r3shape/SSDK) ourselves.\nWe can let `r3make` take care of installation, updates, and linking with [SSDK](https://github.com/r3shape/SSDK) via our configuration:\n\n```json\n{\n    \"main\": {\n        \"sources\": [\"main.c\"],\n        \n        \"libraries\": {\"SSDK\": null},\n        \"gitdeps\": [\"r3shape/SSDK\"],\n        \n        \"name\": \"app\",\n        \"type\": \"exe\",\n        \"dest\": \"build\"\n    }\n}\n```\n\nWith the above configuration, we can use the following command to build, link, and run `app.exe`:\n\n```bash\nr3make -r\n```\n\nYou should see a log similar to `[INFO] Added library 'SSDK' from r3shape/SSDK` in the stream of output from `r3make`, verifying the successful clone/update, and build of the remote dep.\n\n| \u003cb\u003eNOTE:\u003c/b\u003e  \n| A [WARNING] log might appear when utilizing the `gitdeps` field, as an \u003cb\u003eelevated shell\u003c/b\u003e is required for OS-default path manipulation, which is where remote deps are installed to.\n\n---\n\n## Target Configuration Fields\n\n| Field       | Required | Description                                        |\n| ----------- | -------- | -------------------------------------------------- |\n| `sources`   | Yes      | List of glob patterns or file paths to `.c` files. |\n| `type`      | Yes      | `exe`, `dll`, or `lib` (shared/static libraries).  |\n| `dest`      | Yes      | Output directory for built files.                  |\n| `name`      | No       | The name of the output artifact.                   |\n| `flags`     | No       | Additional compiler flags.                         |\n| `defines`   | No       | List of preprocessor defines.                      |\n| `gitdeps`   | No       | List of remote linked libraries.                   |\n| `includes`  | No       | List of include directories.                       |\n| `libraries` | No       | Linked libraries, optionally with paths.           |\n\n---\n\n## CLI Flags\n| Short Flag | Long Flag     | Description                                                                 |\n| ---------- | ------------- | --------------------------------------------------------------------------- |\n| `-t`       | `--target`    | Name of the target to build (e.g., `-t MyApp`). Required unless defaulting. |\n| `-v`       | `--verbose`   | Enables verbose output (shows full commands and file list).                 |\n| `-ccmd`    | `--clangCmd`  | Generates a `compile_commands.json` file for the `clangd` LSP.              |\n| `-nf`      | `--nofiles`   | Disables file discovery; skips glob expansion (useful for debugging).       |\n| `-be`      | `--buildeach` | Forces compilation of all sources individually, even if a library.          |\n| `-r`       | `--run`       | Runs the target after a successful build (only works for `exe` targets).    |\n\n---\n\n## Installation\n\nInstall via pip:\n\n```bash\npip install r3make\n```\n\n---\n\n## Roadmap\n\n* [ ] Incremental builds (skip unchanged files).\n* [ ] Parallel compilation.\n* [ ] Better error messages and diagnostics.\n* [ ] Linux/macOS support.\n* [✔️] Remote dependency fetching (`gitdeps` config field).\n\n---\n\n## Contributing\n\nIssues and pull requests are welcome! If you find a bug, want to suggest a feature, or improve documentation, visit [github.com/r3shape/r3make](https://github.com/r3shape/r3make).\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3shape%2Fr3make","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr3shape%2Fr3make","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr3shape%2Fr3make/lists"}