![]() |
This section contains the list of all rules that can be used in Jamfile—both rules that define new targets and auxiliary rules.
exe
Creates an executable file. See the section called “Programs”.
lib
Creates an library file. See the section called “Libraries”.
install
Installs built targets and other files. See the section called “Installing”.
alias
Creates an alias for other targets. See the section called “Alias”.
unit-test
Creates an executable that will be automatically run. See the section called “Testing”.
compile
, compile-fail
, link
, link-fail
, run
, run-fail
Specialized rules for testing. See the section called “Testing”.
obj
Creates an object file. Useful when a single source file must be compiled with special properties.
glob
The glob
rule takes a list shell pattern
and returns the list of files in the project's source directory that
match the pattern. For example:
lib tools : [ glob *.cpp ] ;
It is possible to also pass a second argument—the list of exclude patterns. The result will then include the list of files patching any of include patterns, and not matching any of the exclude patterns. For example:
lib tools : [ glob *.cpp : file_to_exclude.cpp bad*.cpp ] ;
glob-tree
The glob-tree
is similar to the
glob
except that it operates recursively from
the directory of the containing Jamfile. For example:
ECHO [ glob-tree *.cpp : .svn ] ;
will print the names of all C++ files in your project. The
.svn
exclude pattern prevents the
glob-tree
rule from entering administrative
directories of the Subverion version control system.
project
Declares project id and attributes, including project requirements. See the section called “Projects”.
use-project
Assigns a symbolic project ID to a project at a given path. This rule must be better documented!
explicit
The explicit
rule takes a single
parameter—a list of target names. The named targets will
be marked explicit, and will be built only if they are explicitly
requested on the command line, or if their dependents are built.
Compare this to ordinary targets, that are built implicitly when
their containing project is built.
constant
Sets project-wide constant. Takes two parameters: variable name and a value and makes the specified variable name accessible in this Jamfile and any child Jamfiles. For example:
constant VERSION : 1.34.0 ;
path-constant
Same as constant
except that
the value is treated as path relative to Jamfile location. For example,
if bjam is invoked in the current directory,
and Jamfile in helper
subdirectory has:
path-constant DATA : data/a.txt ;
then the variable DATA
will be set to
helper/data/a.txt
, and if bjam
is invoked from the helper
directory, then
the variable DATA
will be set to
data/a.txt
.
build-project
Cause some other project to be built. This rule takes a single parameter—a directory name relative to the containing Jamfile. When the containing Jamfile is built, the project located at that directory will be built as well. At the moment, the parameter to this rule should be a directory name. Project ID or general target references are not allowed.
test-suite
This rule is deprecated and equivalent to
alias
.