3 releases
0.1.2 | Mar 22, 2024 |
---|---|
0.1.1 | Mar 22, 2024 |
0.1.0 | Mar 22, 2024 |
#130 in Build Utils
12KB
162 lines
███████╗██╗███╗ ███╗██████╗ ██╗ ███████╗ ██████╗ ██╗ ██╗██╗██╗ ██████╗ ██╔════╝██║████╗ ████║██╔══██╗██║ ██╔════╝ ██╔══██╗██║ ██║██║██║ ██╔══██╗ ███████╗██║██╔████╔██║██████╔╝██║ █████╗ ██████╔╝██║ ██║██║██║ ██║ ██║ ╚════██║██║██║╚██╔╝██║██╔═══╝ ██║ ██╔══╝ ██╔══██╗██║ ██║██║██║ ██║ ██║ ███████║██║██║ ╚═╝ ██║██║ ███████╗███████╗ ██████╔╝╚██████╔╝██║███████╗██████╔╝ ╚══════╝╚═╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ -------------------------------------------------------------------------------------- A Simpler yet powerful Build Automation Tool for c (because `make` is hard 😭). Made with ❤️ using 🦀
SimpleBuild is a lightweight build automation tool designed specifically for C projects. It allows you to easily configure your build settings and targets through a simple TOML
configuration file.
Efficient Compilation and Linking (just like make
😉)
SimpleBuild optimizes build times by recompiling only the files that have changed since the last build. It also only relinks the target binary if necessary, minimizing unnecessary compilation and linking steps.
🚀 Installation
To use SimpleBuild, simply download the binary executable for your platform from the Releases page on GitHub. Place the executable in your desired directory and ensure it's included in your system's PATH environment variable.
🧑💻 Usage
1. Create a Configuration File
Create a simplebuild.toml
file in the root directory of your project. This file will contain your build settings and target configurations.
Example simplebuild.toml
[compiler]
name = "gcc"
flags = ["-Wall", "-Wextra", "-Werror"]
includes = ["./external/include/"]
libraries = ["./external/lib/"]
staticlibs = ["m"] # Linked to all targets
dynlibs = ["SDL2"] # Linked to all targets
[build]
dir = "./build"
[[targets]]
name = "main"
source = "main.c"
dependencies = ["utils.c", "helper.c"]
staticlibs = ["pthread"] # Linked only to this target
[[targets]]
name = "test"
source = "test.c"
dependencies = ["utils.c"]
dynlibs = ["curl"] # Linked only to this target
2. Run SimpleBuild
Run the SimpleBuild executable in the same directory as your simplebuild.toml
file
simplebuild main
SimpleBuild will read the configuration from simplebuild.toml
and execute the build process based on the specified settings and targets.
📄 Configuration
The simplebuild.toml
file allows you to define various build settings and target configurations:
[compiler]
: Specifies compiler settings such as name, flags, include directories, library directories, static libraries, and dynamic libraries.[build]
: Defines the build directory where object files and binaries will be stored.[[targets]]
: Specifies individual build targets, including their source files, dependencies, and any additional libraries to link.
🌟 Connect with Us
M. Zahash – zahash.z@gmail.com
Distributed under the MIT license. See LICENSE
for more information.
🤝 Contribute to SimpleBuild!
- Fork it (https://github.com/zahash/simplebuild/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
❤️ Show Some Love!
If you find SimpleBuild helpful, consider giving it a star on GitHub! Your support encourages continuous improvement and development.
Dependencies
~1.5–2.3MB
~43K SLoC