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.3

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.3
File Size Uploaded
bbee-0.0.3.tar.gz 5.8 kB Details

Built distributions (wheels)

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

Total release size: 18.1 kB

Release files / bbee-0.0.3.tar.gz

Download URL bbee-0.0.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b3264197befb01259c2ca1c932e136e96630a6f116dbad9f1aee0cdeca88dfd1
BLAKE2b-256 checksum
How to use checksums
befcf9d0ea1f698ad8669384cdda9d647ecaaaafa33ffdad1823b3ec50b7a952
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.25.0 CPython/3.6.5

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

Download URL bbee-0.0.3-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f638a5d6895099754ac5317d5d1f9773fa87276eb096db57c4696adef4cb15a6
BLAKE2b-256 checksum
How to use checksums
f662f6ecfc225a794d61bf7773081bbc53fdcaa4a8565c806a478677a1bdb9de
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.25.0 CPython/3.6.5

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

Download URL bbee-0.0.3-py2-none-any.whl
Size 6.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
547280a1f698959a67427afc14ee8931d58dab357788856300a789ea2aab9e34
BLAKE2b-256 checksum
How to use checksums
9b5f6c59ce677f9d22b4441a5c54dc477045beb3170eba84f79735cd35dbde86
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.25.0 CPython/3.6.5

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

0.0.6

3 release files

0.0.5

4 release files

0.0.4

4 release files

This release

0.0.3 This release

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