This section contains the list of all rules that can be used in Jamfile—both rules that define new targets and auxiliary rules.
Creates an executable file. See the section called “Programs”.
Creates an library file. See the section called “Libraries”.
Installs built targets and other files. See the section called “Installing”.
Creates an alias for other targets. See the section called “Alias”.
Creates an executable that will be automatically run. See the section called “Testing”.
Specialized rules for testing. See the section called “Testing”.
Creates an object file. Useful when a single source file must be compiled with special properties.
Creates an preprocessed source file. The arguments follow the common syntax.
globrule 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-treeis similar to the
globexcept 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
.svnexclude pattern prevents the
glob-treerule from entering administrative directories of the Subversion version control system.
Declares project id and attributes, including project requirements. See the section called “Projects”.
Assigns a symbolic project ID to a project at a given path. This rule must be better documented!
explicitrule 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.
alwaysfunciton takes a single parameter—a list of metatarget names. The top-level targets produced by the named metatargets will be always considered out of date. Consider this example:
exe hello : hello.cpp ; exe bye : bye.cpp ; always hello ;
If a build of
hellois requested, then the binary will always be relinked. The object files will not be recompiled, though. Note that if a build of
hellois not requested, for example you specify just
byeon the command line,
hellowill not be relinked.
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 ;
constantexcept that the value is treated as path relative to Jamfile location. For example, if b2 is invoked in the current directory, and Jamfile in
path-constant DATA : data/a.txt ;
then the variable
DATAwill be set to
helper/data/a.txt, and if b2 is invoked from the
helperdirectory, then the variable
DATAwill be set to
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.
This rule is deprecated and equivalent to