C++ Boost


rule, alias, depend

A rule describes how to update an artefact using a recipe. An alias defines a means to reference one or more artefacts with a single name / object. Depend allows to make an artefact explicitly dependent one or more other artefacts.

synopsis

rule(recipe, targets, sources=[], dependencies=[], attrs=0, features=(), module=None, path_spec='', logfile=None)

Express how to generate artefacts. In the simplest case this involves a source and a recipe...

Arguments:
  • recipe: an action taking sources as input and producing targets.
  • targets: what to make. This can be a string (typically a filename),
    an existing artefact object, or a list of either strings or artefacts (or a mix thereof).
  • sources: the source to make the artefact from. As with artefacts, this
    may be a string, a artefact, or a list of those.
  • depends: additional dependencies not to be used as source.
  • attrs: flags
  • features: a set of features
  • module: the module to instantiate the artefact in
alias(target, source, attrs=4, module=None)

Declare target to be an alias for source, i.e., update source whenever updating target is requested.

depend(target, dependencies)

Declare target to depend on dependencies.

Examples

# bind target to source using the above rules
obj = rule(compile, 'hello.o', 'hello.cpp')
bin = rule(link, 'hello', obj)
# force obj to be updated whenever header.h is newer.
depend(obj, 'header.h')
# make 'all' an alias for 'hello'
alias('all', bin)

With the above, faber all will update the hello binary.