An open API service indexing awesome lists of open source software.

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.

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