halfling


Namehalfling JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/aloebs29/halfling
SummarySmall C/++ build system written in Python.
upload_time2021-02-23 17:12:43
maintainer
docs_urlNone
authorAndrew Loebs
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # halfling
Small, practical C/++ build system written in Python; supports gcc and clang.

## Installation
```shell
$ pip3 install halfling
```

## Introduction
For some strange reason I felt the urge to create my own build system. This is not intended to be feature rich, free of bugs, or particularly fast. On my machine, builds with halfling are marginally slower than builds with make. Halfling supports incremental builds based on file modified times.

The biggest advantage to halfling is ease of use. Builds are configured with a `halfling.toml` file in the root folder of the project. Most configuration options have reasonable defaults, which means the minimal config file looks like this:

```toml
# This will be the name of the output executable
project_name = "hello_world"

compiler = "clang++"
sources = ["main.cpp"]
```

Your project can then be built by navigating to the same folder with your `halfling.toml` file and running:
```console
$ halfling build
```

To view all of the CLI arguments & options, use `halfling -h`:
```console
$ halfling -h
usage: halfling [-h] [-t {debug,release}] [-j JOBS] {build,clean}

positional arguments:
  {build,clean}         task to be run by halfling

optional arguments:
  -h, --help            show this help message and exit
  -t {debug,release}, --type {debug,release}
                        controls build type; defaults to release
  -j JOBS, --jobs JOBS  controls max processes to run build with; defaults to os.cpu_count()
```

As you can see, halfling can either build your project in debug or release mode, or clean your project (remove the build directory and it's contents). You can also specify the maximum number of processes to run your build with.

A complete TOML with all options specified looks like this:

```toml
# This will be the name of the output executable
project_name = "shotgun"

compiler = "clang++"
sources = [
  "src/main.cpp",
  "src/add.cpp",
  "src/sub.cpp",
]

###### Everything below this line is optional #######

defines = [
  "DEFINED_IN_TOML",
  "ALSO_DEFINED_IN_TOML",
]
include_paths = ["lib/mul/inc"]

libraries = ["mul"]
library_paths = ["lib/mul"]

common_flags = ["-Wall"]
debug_flags = ["-O0"] # defaults to ["-0g", "-g"]
release_flags = ["-O1"] # defualts to ["-02"]

# Specify a different build dir and obj dir -- just to be a contrarian
build_dir = "hbuild" # defaults to build
obj_dir = "hobj" # defaults to obj; this will resolve to {build_dir}/{obj_dir}
```

Example projects can be found in the `examples/` directory.

If you want to do more than what is provided by the CLI, halfling can also be used as a package in your own python scripts. Check the source files in the `halfling/` directory; reasonable docstrings (at least for a lazy person) can be found there.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aloebs29/halfling",
    "name": "halfling",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Andrew Loebs",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/6d/cf/e267fcf954c62954147ceabda0960d67265012dd1386f166cca6b4e2daaa/halfling-0.1.3.tar.gz",
    "platform": "",
    "description": "# halfling\nSmall, practical C/++ build system written in Python; supports gcc and clang.\n\n## Installation\n```shell\n$ pip3 install halfling\n```\n\n## Introduction\nFor some strange reason I felt the urge to create my own build system. This is not intended to be feature rich, free of bugs, or particularly fast. On my machine, builds with halfling are marginally slower than builds with make. Halfling supports incremental builds based on file modified times.\n\nThe biggest advantage to halfling is ease of use. Builds are configured with a `halfling.toml` file in the root folder of the project. Most configuration options have reasonable defaults, which means the minimal config file looks like this:\n\n```toml\n# This will be the name of the output executable\nproject_name = \"hello_world\"\n\ncompiler = \"clang++\"\nsources = [\"main.cpp\"]\n```\n\nYour project can then be built by navigating to the same folder with your `halfling.toml` file and running:\n```console\n$ halfling build\n```\n\nTo view all of the CLI arguments & options, use `halfling -h`:\n```console\n$ halfling -h\nusage: halfling [-h] [-t {debug,release}] [-j JOBS] {build,clean}\n\npositional arguments:\n  {build,clean}         task to be run by halfling\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -t {debug,release}, --type {debug,release}\n                        controls build type; defaults to release\n  -j JOBS, --jobs JOBS  controls max processes to run build with; defaults to os.cpu_count()\n```\n\nAs you can see, halfling can either build your project in debug or release mode, or clean your project (remove the build directory and it's contents). You can also specify the maximum number of processes to run your build with.\n\nA complete TOML with all options specified looks like this:\n\n```toml\n# This will be the name of the output executable\nproject_name = \"shotgun\"\n\ncompiler = \"clang++\"\nsources = [\n  \"src/main.cpp\",\n  \"src/add.cpp\",\n  \"src/sub.cpp\",\n]\n\n###### Everything below this line is optional #######\n\ndefines = [\n  \"DEFINED_IN_TOML\",\n  \"ALSO_DEFINED_IN_TOML\",\n]\ninclude_paths = [\"lib/mul/inc\"]\n\nlibraries = [\"mul\"]\nlibrary_paths = [\"lib/mul\"]\n\ncommon_flags = [\"-Wall\"]\ndebug_flags = [\"-O0\"] # defaults to [\"-0g\", \"-g\"]\nrelease_flags = [\"-O1\"] # defualts to [\"-02\"]\n\n# Specify a different build dir and obj dir -- just to be a contrarian\nbuild_dir = \"hbuild\" # defaults to build\nobj_dir = \"hobj\" # defaults to obj; this will resolve to {build_dir}/{obj_dir}\n```\n\nExample projects can be found in the `examples/` directory.\n\nIf you want to do more than what is provided by the CLI, halfling can also be used as a package in your own python scripts. Check the source files in the `halfling/` directory; reasonable docstrings (at least for a lazy person) can be found there.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Small C/++ build system written in Python.",
    "version": "0.1.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4bceda20ff5d3fb068e9499ab5f90ea6",
                "sha256": "389ab609e97c094a7603260150268d1ff197b0285c3b33a98beefa2c3cd6dcc9"
            },
            "downloads": -1,
            "filename": "halfling-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4bceda20ff5d3fb068e9499ab5f90ea6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 8342,
            "upload_time": "2021-02-23T17:12:42",
            "upload_time_iso_8601": "2021-02-23T17:12:42.613120Z",
            "url": "https://files.pythonhosted.org/packages/52/0a/9a5cb476bdbbe2d56ae7cd39e5f7ccf1c069d9aa542842c0f360e42c381a/halfling-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "c10caa2898e54c16177593c506e575d3",
                "sha256": "16f1d6e5138aaa5859c549716ee8cceec13833558b0f4723f00778185ddad487"
            },
            "downloads": -1,
            "filename": "halfling-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "c10caa2898e54c16177593c506e575d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 7421,
            "upload_time": "2021-02-23T17:12:43",
            "upload_time_iso_8601": "2021-02-23T17:12:43.630715Z",
            "url": "https://files.pythonhosted.org/packages/6d/cf/e267fcf954c62954147ceabda0960d67265012dd1386f166cca6b4e2daaa/halfling-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-02-23 17:12:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "aloebs29",
    "error": "Could not fetch GitHub repository",
    "lcname": "halfling"
}
        
Elapsed time: 0.20939s