3 releases

0.1.2 Mar 22, 2024
0.1.1 Mar 22, 2024
0.1.0 Mar 22, 2024

#43 in Programming languages

Download history 303/week @ 2024-03-22 44/week @ 2024-03-29 6/week @ 2024-04-05

353 downloads per month

MIT license

12KB
162 lines

███████╗██╗███╗   ███╗██████╗ ██╗     ███████╗    ██████╗ ██╗   ██╗██╗██╗     ██████╗ 
██╔════╝██║████╗ ████║██╔══██╗██║     ██╔════╝    ██╔══██╗██║   ██║██║██║     ██╔══██╗
███████╗██║██╔████╔██║██████╔╝██║     █████╗      ██████╔╝██║   ██║██║██║     ██║  ██║
╚════██║██║██║╚██╔╝██║██╔═══╝ ██║     ██╔══╝      ██╔══██╗██║   ██║██║██║     ██║  ██║
███████║██║██║ ╚═╝ ██║██║     ███████╗███████╗    ██████╔╝╚██████╔╝██║███████╗██████╔╝
╚══════╝╚═╝╚═╝     ╚═╝╚═╝     ╚══════╝╚══════╝    ╚═════╝  ╚═════╝ ╚═╝╚══════╝╚═════╝ 
--------------------------------------------------------------------------------------
A Simpler yet powerful Build Automation Tool for c (because `make` is hard 😭). Made with ❤️ using 🦀

Crates.io License: MIT

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.

https://github.com/zahash/

🤝 Contribute to SimpleBuild!

  1. Fork it (https://github.com/zahash/simplebuild/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. 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.6–2.3MB
~46K SLoC