A Minimal Build Tool for C/C++ Projects
Bit is a lightweight build tool designed to make C/C++ project compilation easy and straightforward. No complex configurations, just a single build.bit file to define your project.
Configure your build with a single build.bit file using predefined variables. No need to learn complex build systems.
Compile your C/C++ projects with minimal overhead. Bit focuses on getting your code built, not on complicated rules.
Install with a single command. Choose between stable or development versions based on your needs.
There are multiple ways to install Bit. Choose the method that works best for you:
To remove Bit from your system:
curl -fsSL https://raw.githubusercontent.com/csodelinux/bit/main/scripts/uninstall.sh | bash
Bit simplifies the C/C++ build process by using a straightforward
configuration file named build.bit.
build.bit file in the root of your project
build.bit file
bit in your project directory to build
compiler = g++
flags = -Wall -Werror -std=c++17
build_file = my_program
source_file = main.cpp
build_type = executable
Bit reads the build.bit file in your project directory
and uses the configuration to compile your project.
Simply navigate to your project directory and run:
bit
This will read your build.bit file and compile your
project according to the specified configuration.
Your build.bit file can include the following
variables:
compiler = g++
flags = -Wall -std=c++17
build_file = hello
source_file = hello.cpp
build_type = executable
compiler = g++
flags = -Wall -std=c++17
build_file = test
source_file = main.cpp utils.cpp config.cpp
build_type = executable
compiler = g++
flags = -Wall -std=c++17 -fPIC
build_file = libmylib.so
source_file = lib.cpp helper.cpp
build_dir = lib/
build_type = library
compiler = g++
flags = -Wall -g -O0 -std=c++17
build_file = debug_app
source_file = main.cpp
build_dir = debug/
build_type = executable
The following variables are available in the
build.bit configuration file:
| Variable | Description | Example |
|---|---|---|
compiler |
The compiler to use for the build | compiler = g++ |
flags |
Compiler flags to use | flags = -Wall -Werror -std=c++17 |
build_file |
Name of the output file | build_file = test |
build_dir |
Directory for output files | build_dir = bin/ |
source_file |
Source file(s) to compile | source_file = main.cpp utils.cpp |
build_type |
Type of build (executable or library) | build_type = executable |
Bit does not allow custom variable names. You must use the predefined variables listed above.
Contributions to Bit are welcome! Here's how you can contribute:
git checkout -b feature/feature)
git commit -m 'Add some feature')
git push origin feature/feature)
Before submitting your contribution, make sure your code follows the project's coding style and passes all tests.