Using Jam

Haiku uses a custom fork of Perforce's Jam. This mailing list thread helps to explain the decision to fork jam.

As of December 2011, this is the current version. If a different version is reported, then you will need to build and install jam from source.

jam -v
Jam 2.5-haiku-20111222. OS=LINUX. Copyright 1993-2002 Christopher Seiwald.

Building Jam from Source

Haiku's version of jam lives inside the buildtools repository. If you need to, see this page on Getting Haiku Source Code.

cd  /path/haiku/buildtools/jam/
make
<jam-install-command>

<jam-install-command>

To install jam you can use one of two commands:
The first requires administrative privilege, as jam will be installed to '/usr/local/bin/'

  • sudo ./jam0 install
  • ./jam0 -sBINDIR=$HOME/bin install

Note, you may need to use `gmake` instead of `make`

Command Line Options

Only some of the options are being discussed here. See jam -h for a full listing of available options.

  • -q

    Typically jam will attempt to build all targets, even if an error is encountered. '-q' instructs jam to quit immediately upon encountering an error. This is preferred, as it helps to find the actual cause for build failure.

  • -j#

    Where # represents the number of threads to use. This is useful when building on SMP or multi-core machines.

    Jam suffers from a bug that might make your build fail when using this option.
  • -a

    Build all targets, even if they are current. Normally, this is not necessary.
    You may need to do this once in a while because some of the jam rules are not perfect and does not set the dependencies between files properly. The most frequent case is when we update our copy of Freetype : this will prevent anyone to build without the -a switch.
    You can also use this switch if something does not seem to get updated after some change you made. This is the case when you modify a jamfile : Jam does not check for that and will not rebuild things that should be affected by the changes.

  • -sx=y

    Set variable x=y, overriding environment. One example is :

        jam -sHAIKU_IGNORE_USER_BUILD_CONFIG=1 -q @release-raw
    

    This will ensure that the release-* targets are built to the exact specifications of Haiku's DefaultBuildProfiles.

  • -dX

    Enables debug output, where X can be one of the following:

    • (a)actions
    • (c)causes
    • (d)dependencies
    • (m)make tree
    • (x)commands
    • (0-9) debug levels
  • -n

    Don't actually execute the updating actions. This seems to be useful for testing Jamfiles.

Possible Targets

Official Release Targets

The following targets are defined in build/jam/DefaultBuildProfiles

  • @rel