What's the catch?

You have to set up your source code in a coherent "depot". This just means that everything for your project must be contained within a single directory root. You must also include your header files using paths which are relative to the depot root, like this: #include "http/server.h"

How do you create a depot root?

Create a file called .depot.root in a directory, and it's a depot root. Just use "touch". Then create a directory called "src" under that and you're ready to start writing code.

So what does a depot look like?

Here's an example of a simple depot.

I need a sample depot to get started

Okay, here you go: download test_depot.tar.gz

Open that up with 'tar zxf test_depot.tar.gz', cd into test_depot, then try building some of the targets in there. Commands to try are:

dep_cli top_level_target

dep_cli util/tool

You want me to type "dep_cli" every time I build something? That underscore is evil!

Nope. I recommend you make a shell alias or short script to call it for you, like this:

alias bb='dep_cli -c default'

Or, if you like a tiny script:

#!/bin/sh
dep_cli -c default || exit 1
    

Then you can just run bb util/tool. Easy! If 'bb' doesn't suit your fingers, use anything else you like.

How does this work with git?

Running "git init" in your "src" directory will get things started.

What about libraries in other places?

System libraries use the angle bracket syntax, like this: #include <libmicrohttpd.h>. Libraries which need special compile-time or link-time flags can be configured using .build.conf hints.

Where do objects and binaries go?

More directories will automatically be created under your depot root as you run build commands. The default output directory is "bin", and it mirrors the "src" tree. Your bin directory might look like this given the above example tree after you run dep_cli top_level_target:

Notice that lib1/lib1.o was built automatically since top_level_target.cc references it with an #include.

Default output directory? There are others?

There are other types of builds which are supported but are not yet documented in the interest of simplicity. This feature is used for adding extra debug symbols, enabling coverage runs, profiling, and optimized (stripped) builds.

Why only C++ and .cc/.h files?

This project exists to scratch an itch I had, and that itch was making my C++ code base compile without using Make. For a first release, I think this is sufficient. If there is demand for other things, then I will consider adding it.

In other words, download it, play with it, then send me a message and tell me that you're using it.

Have fun!

« How dependencies work Download now »