https://github.com/alessandro-salerno/cbuild
A work-in-progress small and simple build system meant for smaller C Projects.
https://github.com/alessandro-salerno/cbuild
build-system c pip-package python python-package python3 toml
Last synced: 27 days ago
JSON representation
A work-in-progress small and simple build system meant for smaller C Projects.
- Host: GitHub
- URL: https://github.com/alessandro-salerno/cbuild
- Owner: Alessandro-Salerno
- License: mit
- Created: 2022-07-06T17:03:14.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-05T16:52:06.000Z (over 2 years ago)
- Last Synced: 2025-01-28T08:51:17.400Z (over 1 year ago)
- Topics: build-system, c, pip-package, python, python-package, python3, toml
- Language: Python
- Homepage:
- Size: 325 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CBuild
CBuild is a small and simple build system for tiny C Projects.
## Project Structure
CBuild is structured as a Python Package, as such, it needs to be installed via the pip package manager.
## Installing CBuild
* Windows:
```
pip install git+https://github.com/Alessandro-Salerno/CBuild
```
* macOS/Linux:
```
pip3 install git+https://github.com/Alessandro-Salerno/CBuild
```
## Using CBuild in a C Project
* Create a file named `CBuild.json` in your project's main directory using the following command:
```
-m cbuild --setup
```
The output file should look something like this:
```json
{
"directories": {
"source": [ "src" ],
"include": [ "include" ],
"output": "dist"
},
"build": {
"compiler": "gcc",
"file extension": ".c",
"name": "Example",
"release": true,
"format": "exec"
}
}
```
* Run CBuild via Python (`python3 -m cbuild` on macOS/Linux, `py -m cbuild` on Windows)
## Building CBuild
### Requirements
* Python 3.7 or newer
* The Python `build` module
* The `hatchling` backend
### Procedure
* Clone this repository
* Run the `build` module via Python (`python3 -m build` on macOS/Linux, `py -m build` on Windows)
* Install CBuild using `pip` and the `.whl` in the `dist` directory
## Structure of `CBuild.json`
### directories
* **source:** A list of directories that contain source files
* **include:** A list of directories which should be treated as include paths
* **output:** The directory where the final binar will be stored
### build
* **compiler:** Path to a compiler binary
* **file extension:** The file extension used by source files
* **name:** The project's name (Used as name for the final binary)
* **release:** Wether the project should be built in release mode or not
* **format:** Unused for now