Zefina  Zefina: Build: Make And Builder

Building The Project: Beginner Level

The Zefina Project uses make for its build system. Use make from the root of the repo (or source code tree), like any other project utility.

To build everything:

> make release

Want everything with debugging info?

> make debug

To build only the Zefina Service (and it's modules)

> make zefina

Compile options are also supported:

> make zefina SOME_NAME=1 ANOTHER_NAME=1

See Build: Compile Options for more details.

Building The Project: Master Level

In the bin/ directory is a script: ./bin/builder. This script will automatically build the Zefina Project or a subset when it detects a change in the source code. The basic usage of this script is:

> ./bin/builder --watch-recursive 'zefina,*.c,*.h' --target-build zefina-debug

This will cause the ./bin/builder script to monitor all the *.c and *.h files in the zefina/ directory. When one of those files changes (or a file is created or deleted), ./bin/builder will run the make zefina command.

It is also possible to link multiple ./bin/builder scripts together so that when one completes successfully it will notify another ./bin/builder to build it's target. An example of this would be to trigger a test build after a successful zefina-debug build. To link ./bin/builder scripts together, use the --chain-out and --chain-in args.

> ./bin/builder --watch-recursive 'zefina,*.c,*.h' --chain-out debug --target-build zefina-debug

Now, after this instance of ./bin/builder invokes make zefina-debug (and it successfully builds), the chain named debug will be notified. In another terminal, run an instance of ./bin/builder that will do a test build when the debug chain is notified.

> ./bin/builder --chain-in debug --target-build test

And like using make directly, the builder also supports compile options:

> ./bin/builder --target-build zefina SOME_NAME=1 ANOTHER_NAME=1 --target-clean zefina-clean

See Build: Compile Options for more details.

And this is just scratching the surface. Many ./bin/builder scripts can use the same chain for notification. ./bin/builder scripts are also able to listen for notifications from multiple chains.

How can you use ./bin/builder to automate your builds? When you figure that out... Welcome to the Master Level!