MiniBuild tutorial

Vitaly Murashev

Introduction

MiniBuild build system is a pure Python package aimed to build executables, static and shared libraries from C, C++ and ASM source files. Build process can be launched from any directory containing a minibuild.mk file. This file describes what type of binary is going to be built and its dependencies on other modules inside a directory tree of your project.

Glossary

minibuild.ini

A file used to configure the build system for your project. It prescribes what compiler toolchain is used for each target platform. A directory where this file located is treated as project-root directory.

project-root directory

A directory being treated as project-root. Build system expects that all source files held somewhere inside it. Moreover minibuild.ini file is supposed to be placed there.

output directory

A directory holding the output of the build system. The build system attempts to isolate all file modifications to this directory. Its path is <project-root>/output.

minibuild.mk - Grammar reference

Build-system treats minibuild.mk file as a generic description of a module being built. While this file remains a module written in the Python programming language, it is supposed to have some predefined global variables which are picked up and interpreted directly by the build system framework. These variables are also mentioned below as grammar tokens.

Some grammar tokens are ISA (instruction set architecture) extendable. So if for example grammar token var marked as ISA extendable, than the following grammar tokens are supported as well: var_linux, var_linux_arm, var_linux_arm64, var_linux_x86, var_linux_x86_64, var_macosx, var_macosx_arm, var_macosx_arm64, var_macosx_x86, var_macosx_x86_64, var_posix, var_posix_arm, var_posix_arm64, var_posix_x86, var_posix_x86_64, var_windows, var_windows_arm, var_windows_arm64, var_windows_x86, var_windows_x86_64

Some other grammar tokens are platform extendable. So if for example grammar token var marked as platform extendable, than the following grammar tokens are supported as well: var_linux, var_macosx, var_posix, var_windows