This interface defines a set of user-supplied methods that are invoked
during the Build Model's makefile generation process. These methods
can augment or modify the commands that are placed in the generated
makefiles. For example, an ITargetFilter module can add pre or post
build steps for virtually any generated file.
Filters are created implicitly when a target's profile
(
xdc.bld.ITarget.profiles) that references the filter is used.
To use a filter, one must configure a profile's option set
(
xdc.bld.ITarget.OptionSet) in the build configuration script
config.bld. It is possible to add filters to existing profiles (such
as
"debug" and
"release") or to create entirely new profiles that
utilize the filters.
When modifying existing profiles, no changes to individual packages using
these profiles is required; one simply has to clean and rebuild these
packages for the filters to have an effect.
By adding new profiles, one can ensure that existing build artifacts are
unchanged and only those packages that want to take advantage of a filter
can do so easily by adding a new build artifact that uses the new
profile; for example, see
xdc.bld.Library.Attrs.
struct ITargetFilter.GenDesc |
|
Configuration file generation descriptor
metaonly struct GenDesc {
String template;
// name of the template to expand
String file;
// the name of the file to generate
};
DETAILS
This structure is used to specify a new file to be generated during
the configuration process.
Templates are expanded in the context of the Configuration domain;
as a result, the contents of the generated file can be a function
of an executable's
xdc.cfg.Program object. Template names
are interpreted using the
xdc.findFile() method to
locate the template file name. Templates can, therefore, be
contained in any package located along the package path.
Names of files to be generated are always interpreted relative to
the base directory of the package for which makefiles are being
generated.
SEE
struct ITargetFilter.InstDesc |
|
ITargetFilter Instance descriptor
metaonly struct InstDesc {
String moduleName;
// name of a module implementing ITargetFilter
Any params;
// params passed to ITargetFilter.create()
};
DETAILS
This structure provides the information necessary to create an
instance of an ITargetFilter.
SEE
struct ITargetFilter.MacroDesc |
|
Macro definition descriptor
metaonly struct MacroDesc {
String name;
// name of the macro
String value;
// the name value of the macro name
};
DETAILS
This structure is used to specify macro name-value pairs that are
added to the generated makefiles. These names can be used
by commands added via the filter's
archive(),
compile(), or
link() methods.
Using symbolic values in lieu of embeddeding explicit paths or values
enables the end-user to re-define these values without requiring
regeneration of makefiles.
SEE
per-instance config parameters |
|
XDCscript usage |
meta-domain |
var params = new ITargetFilter.Params;
// Instance config-params object
ITargetFilter.archive( ) // per-instance |
|
Archive command filter
function archive( container, lib, objList, archArgs, result );
ARGUMENTS
container
String
DETAILS
This method is called for every archive created by the package's
build script (via
xdc.bld.PackageContents.addLibrary()).
ITargetFilter.compile( ) // per-instance |
|
Compile command filter
function compile( container, target, goal, compArgs, result );
ARGUMENTS
container
String
goal
String goal file
DETAILS
This method is called for every object created by the package's
build script (via
xdc.bld.Executable.addObjects(),
xdc.bld.Library.addObjects(), ...).
ITargetFilter.getDefs( ) // per-instance |
|
Get table of macro definitions
DETAILS
This method is called during makefile generation to obtain
a list of macro definitions that are to be added to the
generated makefile. These macros can then be referenced by
commands added via a filter function (
archive(),
compile() or
link()).
RETURNS
ITargetFilter.getGenTab( ) // per-instance |
|
Get table of files to be generated during configuration
function getGenTab( prog, cfgDir, configName );
ARGUMENTS
cfgDir
String directory where generated config files are
placed
configName
String base name of the configuration
DETAILS
This method is called during makefile generation to obtain
a list of additional files to be generated during configuration.
RETURNS
ITargetFilter.link( ) // per-instance |
|
Link command filter
function link( container, cfgBase, prog, objList, linkArgs, result );
ARGUMENTS
container
String
cfgbase
String
prog
Executable or Assembly
objList
String
DETAILS
This method is called for every executable created by the package's
build script (via
xdc.bld.PackageContents.addExecutable(),
...).