Skip to main content

A small C/C++ Builder

Project description

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 .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bbee-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

bbee-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file bbee-0.1.0.tar.gz.

File metadata

  • Download URL: bbee-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for bbee-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1919f625b095f63845d5daded0d84db0b5633640b7e0d1df1355894a42f21dd6
MD5 0aa6ed798c9d477231902dd3bc8da479
BLAKE2b-256 bc803027eb30f131d8082d962727033ab126c2e952316493ace550d6f142336e

See more details on using hashes here.

File details

Details for the file bbee-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bbee-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.5

File hashes

Hashes for bbee-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2067699a3a47d82a9dfe38d69f36ded08d7ebf67db970b3d688ee7c733223c9
MD5 ab4e2de3bb52e9ece383da5e2c5786ba
BLAKE2b-256 075092e3e76dfbcf3383c577d4108217a984cac653e80ed5ab82448e8c5f2e1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page