# TBuild

TBuild is a build system for TempleOS and ZealOS. It features automatic code
conversion for ZealOS and dependency management.

## Building and installing

To build and install, simply run `./build.sh`. After it has finished compiling,
you can put the built `tbuild` binary anywhere in your PATH. Make sure you also
put in the same directory the corresponding RedSeaGen binary for your system.

## Usage

```
Usage: tbuild [command]

Commands:
 * init|i [path=.] - Setup a new project.
 * build|. [--zeal|-z|-Z] - Build project in current working directory.
 * clean - Clean output code in current working directory.

To see manifest file usage, check out man tbuild(1)
```

## Manifest file

The manifest file is a file in the TOML format which contains metadata about
your project. There are two main sections: `General` and `Dependencies`.

### The General section

 - Name: str - The name of the project.
 - Author: str - The name of the author.
 - Version: str - The project's version.

### The Dependencies section

This section follows a format for each dependency:

```
<name> = "<git url>"
```

So, for example, if you wish to add the ac97 loadable driver into your project,
you can add an entry like such:

```
[Dependencies]
ac97 = "https://git.checksum.fail/slendi/ac97.git"
```

And if you wish to be in a `AC97` directory instead:

```
[Dependencies]
AC97 = "https://git.checksum.fail/slendi/ac97.git"
```

The dependencies get pulled in and updated at build time.

## Scripts

You can run Python scripts after your files are placed inside the `build`
directory by creating a `scripts` folder in the root of your project.

It's important to note that scripts DO NOT respect the project's path. As such,
it is highly recommended to use something like this:

```python
import os
dir_path = os.path.dirname(os.path.realpath(__file__)) + '/..'
```

It is also important to note that you can have as many subdirectories as you
wish.

