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

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.7
File Size Uploaded
bbee-0.0.7.tar.gz 6.1 kB Details

Built distributions (wheels)

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

Total release size: 18.7 kB

Release files / bbee-0.0.7.tar.gz

Download URL bbee-0.0.7.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
066630ac98d37b05c1572ea3f5f24102dfa88aec2b75c6e42243aace8adc5879
BLAKE2b-256 checksum
How to use checksums
4dba69a2ddefdec5bb7587ef3f2b869bd9e89e325df241ad457245e9bbb49e6b
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.7-py3-none-any.whl

Download URL bbee-0.0.7-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
254af07f7092c6ce370b8a07f4de6970efead072e16fe0d0010364345a368d63
BLAKE2b-256 checksum
How to use checksums
0a6e54d0b151e79ecbc518eb8f91fe7c110a0e6d413bfbd3367d60922b27a16f
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.7-py2-none-any.whl

Download URL bbee-0.0.7-py2-none-any.whl
Size 6.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
5a699d76dae3468ba31ce31836c3f2662ce33bc2074ce7437f936cf29fad8020
BLAKE2b-256 checksum
How to use checksums
3c2e6be7c18a9ad17a0503558ad06d76dc06ed78e5f125d557762031c67c5dea
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

This release

0.0.7 This release

3 release files

0.0.6

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