Bit

A Minimal Build Tool for C/C++ Projects

Simplify Your C/C++ Build Process

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.

<<<<<<< HEAD

Simple Configuration

Configure your build with a single build.bit file using predefined variables. No need to learn complex build systems.

Efficient Compilation

Compile your C/C++ projects with minimal overhead. Bit focuses on getting your code built, not on complicated rules.

Easy Installation

Install with a single command. Choose between stable or development versions based on your needs.

Installation

There are multiple ways to install Bit. Choose the method that works best for you:

Quick Install (Stable)

=======

Simple Configuration

Configure your build with a single build.bit file using predefined variables. No need to learn complex build systems.

Efficient Compilation

Compile your C/C++ projects with minimal overhead. Bit focuses on getting your code built, not on complicated rules.

Easy Installation

Install with a single command. Choose between stable or development versions based on your needs.

Installation

There are multiple ways to install Bit. Choose the method that works best for you:

Quick Install (Stable)

curl -fsSL https://raw.githubusercontent.com/csodelinux/bit/main/install.sh | bash

Installs the latest stable version of Bit.

Build from Source

git clone https://github.com/csodelinux/bit.git
                                                cd bit
                                                make install

Clone the repository and build it yourself.

Dependencies

makefiles
G++ or clang++
C++ 17 compatible compiler

Uninstall

To remove Bit from your system:

>>>>>>> bdcfe11fdf0db46221bb6ce8f00fee5e1122e430
                                        curl -fsSL https://raw.githubusercontent.com/csodelinux/bit/main/scripts/stable.sh | bash

Installs the latest stable version of Bit.

Development Version

                                    curl -fsSL https://raw.githubusercontent.com/csodelinux/bit/main/scripts/dev.sh | bash

Installs the latest development version with newest features.

Build from Source

                                    git clone https://github.com/csodelinux/bit.git
                                    cd bit
                                    sudo make install

Clone the repository and build it yourself.

Dependencies

makefiles
G++ or clang++
C++ 17 compatible compiler

Uninstall :

sudo

To remove Bit from your system:

                            curl -fsSL https://raw.githubusercontent.com/csodelinux/bit/main/scripts/uninstall.sh | bash

Documentation

Getting Started with Bit

Bit simplifies the C/C++ build process by using a straightforward configuration file named build.bit.

Create Your First Project

1
Create a new directory for your project
2
Create a build.bit file in the root of your project
3
Add your source files to the project directory
4
Define your build configuration in the build.bit file
5
Run bit in your project directory to build

Basic build.bit File

                                compiler = g++
                                flags = -Wall -Werror -std=c++17
                                build_file = my_program
                                source_file = main.cpp
                                build_type = executable

Using Bit

Bit reads the build.bit file in your project directory and uses the configuration to compile your project.

Running Bit

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.

Configuration Options

Your build.bit file can include the following variables:

compiler
The compiler to use (e.g., g++, clang++)
flags
Compiler flags to use
build_file
Name of the output file
build_dir
Directory for output files
source_file
Source file(s) to compile
build_type
Type of build (executable or library)

Example Projects

Simple Executable

                                        compiler = g++
                                        flags = -Wall -std=c++17
                                        build_file = hello
                                        source_file = hello.cpp
                                        build_type = executable

Multiple Source Files

                                        compiler = g++
                                        flags = -Wall -std=c++17
                                        build_file = test
                                        source_file = main.cpp utils.cpp config.cpp
                                        build_type = executable

Creating a Library

                                        compiler = g++
                                        flags = -Wall -std=c++17 -fPIC
                                        build_file = libmylib.so
                                        source_file = lib.cpp helper.cpp
                                        build_dir = lib/
                                        build_type = library

Debug Build

                                        compiler = g++
                                        flags = -Wall -g -O0 -std=c++17
                                        build_file = debug_app
                                        source_file = main.cpp
                                        build_dir = debug/
                                        build_type = executable

Reference

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.

Contribution

Contributions to Bit are welcome! Here's how you can contribute:

Fork the repository
Create your feature branch (git checkout -b feature/feature)
Commit your changes (git commit -m 'Add some feature')
Push to the branch (git push origin feature/feature)
Open a Pull Request

Before submitting your contribution, make sure your code follows the project's coding style and passes all tests.