Skip to main content

bbee

Very simple C - C++ Builder

I wrote this little script to help me out with little C or C++ codes.

It basically crawls for sources, compiles and links the objects either to executable binary or to static library. (I love static libraries)

Sometimes I do not want to spend time writing Makefile scripts

thus while sending some sample codes to ppl, I include this.

This has a little convention so as long as you keep the convention, things will be successfully built.

Please note that, I did not wrote this little tiny script for big and complex projects, stick to cmake or autotools if you are planning to write sth complex.

Other than that, this script would do the job for you as well;

Quick Start

Simple run the command below to create an empty C project. This will create an empty directory tree with includes, build and source directory as well as a capul.json file already configured. You can create your main.c inside source directory and start by calling bbee command to compile and run.

bbee --create

Or run the command below to create an empty C++ project

bbee --create++

Parameters:

Field Name Option Type Description Example
name str Name of the project "sample"
builder str Builder command "gcc" or "/usr/bin/gcc-7"
sources list List of sources (directory or files) ["./source", "main.c"]
includes list List of includes (dir or files) ["./include", "/usr/local/includes"]
libraries list List of libraries to link ["pthread", "GL", "m"]
frameworks list List of frameworks to link (MacOS) ["OpenGL", "GLUT"]
library_search_paths list List of library directories ["./libs", "/usr/local/lib"]
output library / binary str Output format, binary exec. or a lib "binary"
output_dir str Where to put the output file(s) "build"
output_name str Output file name "hello_world" or "libmylib.a"
cflags str gcc extra flags "-std=gnu99 -Wall -Werror -O3 -g"
debug true / false bool BBee Debug Mode on / off false
source_extension str Extension to crawl for compiling ".c"
run_after_build bool Run the binary output file after false
install list List of installation directives See below at "how to make install"

How to make install

Creating an installation directive is quite easy, just tell what to copy and where to copy it.

If target directory name starts with ! then it will be created with "mkdir -p" command

# This example will copy build/hello_world to /usr/local/bin
[
    ["build/hello_world", "/usr/local/bin"]
]


# This example will try to copy build/hello_world to first directory it can verify
# if the directory does not exists, it will try the next directory in the list
[
    ["build/hello_world", ["/usr/local/bin", "/usr/bin"]]
]


# This will copy the headers include folder to includes and copy the library to libs
[
    ["./includes", "!/usr/local/includes/mylib"],
    ["build/libmylib.a", ["/usr/local/lib", "/usr/lib"]]
]

Here is a sample capul.json file

{
    "name": "Hello World",
    "builder": "gcc",
    "sources": [
        "./src"
    ],
    "includes": [
        "./include"
    ],
    "libraries": [
        "pthread"
    ],
    "library_search_paths": [
        "/usr/local/lib"
    ],
    "frameworks": [
        "OpenGL",
        "GLUT"
    ],
    "output": "binary",
    "output_dir": "build",
    "output_name": "hello_world",
    "cflags": "",
    "debug": true,
    "source_extension": ".c",
    "run_after_build": False
}

Note: just "sources", "output" fields are mandatory, others are optional.

If you want to contribute, please keep the code a single file and pep8 should pass without errors or warnings .

Metadata

Release files for bbee 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bbee 0.0.6
File Size Uploaded
bbee-0.0.6.tar.gz 6.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bbee 0.0.6
File Interpreter ABI Platform
bbee-0.0.6-py3-none-any.whl Python 3 none any Details
bbee-0.0.6-py2-none-any.whl Python 2 none any Details

Total release size: 18.6 kB

Release files / bbee-0.0.6.tar.gz

Download URL bbee-0.0.6.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cb7a456503c01d80da7d63980731ee2dd96f0cea0d123ecc25b3efbb3e7a25f9
BLAKE2b-256 checksum
How to use checksums
db74eef6047c3adb3431a65de8c75a250128e93bb1b08413b3e40226fc07f807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

Release files / bbee-0.0.6-py3-none-any.whl

Download URL bbee-0.0.6-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06917a0bf1f68637f0c77ee6eb6e5a8d5cae28feae0e45c42a33e343494a71f9
BLAKE2b-256 checksum
How to use checksums
cc9bf65f89cad09dbc616661d4ba0fe02443ffad276945e49f395827f96d55f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

Release files / bbee-0.0.6-py2-none-any.whl

Download URL bbee-0.0.6-py2-none-any.whl
Size 6.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
d98b461c1d478a74827adcd917290a10e69c467db6be7218911692fef62f929b
BLAKE2b-256 checksum
How to use checksums
5bb995698d055a6b7eefdd8d8a04ef43e5ee1e56715eeba2f02d2e24e3496a3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15

Release history Release notifications | RSS feed

0.1.0

2 release files

0.0.9

3 release files

0.0.8

3 release files

0.0.7

3 release files

This release

0.0.6 This release

3 release files

0.0.5

4 release files

0.0.4

4 release files

0.0.3

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page