Loading...
Searching...
No Matches
L4Re Build System

L4Re uses a custom make-based build system, often simply referred to as BID. This section explains how to use BID when writing applications and libraries for L4Re.

# Building L4Re

## Setting up the Build Directory

L4Re must be built out-of-source. Therefore the first mandatory step is creating and populating a build directory. From the root of the L4Re source tree run

    make B=<builddir>

Other targets that can be executed in the source directory are

update
  Update the source directory from svn. Only makes sense when you have downloaded L4Re from the official subversion repository.

help
  Show a short help with the most important targets.

## Invoking Make

Once the build directory is set up, BID make can be invoked in one of two ways:

1. Go to the build directory and invoke make without special options.
2. Go to a source directory with a BID make file and invoke make O=<builddir> ....

The default target builds the source (as you would expect), other targets that are available in build mode are

cleanfast
  Quickly cleans the build directory by removing all subdirectories that contain generated files. The configuration will remain untouched.

clean
  Remove generated files. Slower than make cleanfast but can be used on selected packages. Use S=... to select the target package.

In addition to these targets, there are a number of targets to generate images which are explained elsewhere.

# Writing BID Make Files

The BID build system exports different roles that define what should be done in the subdirectory. So a BID make file essentially consists of defining the role and a number of role-dependent make variables. The basic layout should look like this:

PKGDIR ?= <path to package's root directory> # e.g., '.' or '..'
L4DIR ?= <path to L4Re source directory> # e.g. '$(PKGDIR)/../..'
<various definitions>
include $(L4DIR)/mk/<role>.mk

PKGDIR in the first line defines the root directory of the current package. L4DIR in the next line must be pointed to the root of the L4Re source tree the package should be built against. After this custom variable definitions for the role follow. In the final line of the file, the make file with the role-specific rules must be sourced.

The following roles are currently defined:

- project.mk - Sub-project Role
- subdir.mk - Directory Role
- prog.mk - Application Role
- lib.mk - Library Role
- include.mk - Header File Role
- doc.mk - Documentation Role
- test.mk - Test Application Role
- idl.mk - IDL File Role (currently unused)
- runux.mk - Tests in FiascoUX Role

## BID-global Variables

This section lists variables that configure how the BID build system behaves. They are applicable for all roles.

Variable | Description
--- | ---
CC | C compiler for target
CXX | C++ compiler for target
HOST_CC | C compiler for host
HOST_CXX | C++ compiler for host