metaonly module iar.tools.configuro.Main

Command implementation

This command-line tool computes the appropriate configuro options from the set of options passed from the IAR Workbench (for ex. target/platform from compile options). With these options, the xdc.tools.configuro tool is executed to compute the set of libraries, command-line flags and the other artifacts needed to build the application in IAR Workbench. [ more ... ]
Configuration settings sourced in iar/tools/configuro/Main.xdc
var Main = xdc.useModule('iar.tools.configuro.Main');
module-wide config parameters
    Main.usage// usage help message = String[] [
        '[-o outdir (optional)]',
        '[-c codegen_dir]',
        '[--cc compiler_name_string]',
        '[--cfgDir configfile_dir]',
        '[--device device_name]',
        '[compileOptions compile_options_str (should be the last option]'
    ];
module-wide functions
    Main.exec// xs script entry point(Any args) returns Any
    Main.main// xs shell entry point(Any args) returns Any
per-instance config parameters
    var params = new Main.Params// Instance config-params object;
        params.cfgDir// Root directory containing the configuration file = String null;
        params.compileOptions// Compile options used for building C files = String null;
        params.compiler// The name of the compiler = String null;
        params.device// The name of the device = String null;
        params.output// Pathname of the output directory = String null;
        params.rootDir// Root directory of the code generation tools = String null;
per-instance functions
    inst.run// Underlying implementation of the command(Cmdr.Instance cmdr, String[] args) returns Any
 
DETAILS
This command-line tool computes the appropriate configuro options from the set of options passed from the IAR Workbench (for ex. target/platform from compile options). With these options, the xdc.tools.configuro tool is executed to compute the set of libraries, command-line flags and the other artifacts needed to build the application in IAR Workbench.
INPUTS
-o outdir (Optional)
Optionally a output directory can be provided.
-c codegen_dir
Root directory of the code generation tools.
--cc compiler_name_string
The name of the compiler.
--cfgDir configfile_ dir
The directory that contains RTSC configuration file. Only one config file is expected to be in the directory.
--device device_name_string
The name of the device.
compileOptions compile_options_string
The command line options passed to the compiler. This should be the last option. Any option after the compileOptions string is considered to be command line compile options.
OUTPUTS
outdir/
A directory containing all generated build artifacts.
outdir/compiler.defs
A file containing C compiler command-line flags. These flags must included on the compiler command line for any C source file that directly accesses the RTSC content. The flags define the header file and include paths to ensure object code compatibility between all all included content.
outdir/linker.cmd
A file containing linker command-line flags. These flags must be included on the linker command line for the final link of the application. The flags list needed libraries and object files, and on some platforms define the embedded system memory map.
For example:
      xs iar.tools.configuro -c "<codegen_dir>" --cc "<compiler>"
         --cfgDir "<configfile_dir>" --device "<device_name>"
         compileOptions "<compiler_options>"
 
config Main.usage  // module-wide

usage help message

Configuration settings
Main.usage = String[] [
    '[-o outdir (optional)]',
    '[-c codegen_dir]',
    '[--cc compiler_name_string]',
    '[--cfgDir configfile_dir]',
    '[--device device_name]',
    '[compileOptions compile_options_str (should be the last option]'
];
 
 
Main.exec()  // module-wide

xs script entry point

Configuration settings
Main.exec(Any args) returns Any
 
DETAILS
This function is called from within other XDCscript scripts and performs the same operations as main() except that, rather than output the return value of inst.run(), this value is simply returned to the caller of exec().
 
Main.main()  // module-wide

xs shell entry point

Configuration settings
Main.main(Any args) returns Any
 
DETAILS
This function
  • creates a no-arg instance, inst, of the module inheriting this interface;
  • parses command line arguments placing all options in the config params of the inheriting module;
  • creates a xdc.tools.Cmdr instance, cmdr;
  • calls inst.run() with the cmdr and any command line command line arguments not parsed as options; and
  • outputs the return result from inst.run()
Instance Config Parameters

Configuration settings
var params = new Main.Params;
// Instance config-params object
    params.cfgDir = String null;
    // Root directory containing the configuration file
    params.compileOptions = String null;
    // Compile options used for building C files
    params.compiler = String null;
    // The name of the compiler
    params.device = String null;
    // The name of the device
    params.output = String null;
    // Pathname of the output directory
    params.rootDir = String null;
    // Root directory of the code generation tools
 
config Main.cfgDir  // instance

Root directory containing the configuration file

Configuration settings
var params = new Main.Params;
  ...
params.cfgDir = String null;
 
DETAILS
The directory is searched for configuration file (with extension .cfg). The directory should contain only one configuration file. In case of multiple configuration files, only the first configuration file in the alphabetical order will be passed to xdc.tools.configuro.
 
config Main.compileOptions  // instance

Compile options used for building C files

Configuration settings
var params = new Main.Params;
  ...
params.compileOptions = String null;
 
DETAILS
The compiler options are required to find the target and platform options for xdc.tools.configuro.
 
config Main.compiler  // instance

The name of the compiler

Configuration settings
var params = new Main.Params;
  ...
params.compiler = String null;
 
DETAILS
The compiler name is required to find the target and platform xdc.tools.configuro options.
 
config Main.device  // instance

The name of the device

Configuration settings
var params = new Main.Params;
  ...
params.device = String null;
 
DETAILS
The device name has to be passed to the xdc.tools.configuro tool.
 
config Main.output  // instance

Pathname of the output directory

Configuration settings
var params = new Main.Params;
  ...
params.output = String null;
 
DETAILS
A directory containing the generated build artifacts, in particular the compiler.defs and linker.cmd files.
The last component of the output directory path must be a valid ANSI C identifier; i.e., it must consist entirely of alphanumeric or '_' characters and must not start with a number. So, the names '0app' and 'app-test' are not valid but '0app/config' and 'app-test/config' are valid.
This is optional parameter. By default, the output directory has the name configPkg and will be within the {#cfgDir} directory.
 
config Main.rootDir  // instance

Root directory of the code generation tools

Configuration settings
var params = new Main.Params;
  ...
params.rootDir = String null;
 
DETAILS
The path to the installation directory of the compiler and linker for the selected target. The definition of "installation directory" can vary from compiler to compiler, but is most commonly the directory that contains a "bin" subdirectory.
 
Main.run()  // instance

Underlying implementation of the command

Configuration settings
inst.run(Cmdr.Instance cmdr, String[] args) returns Any
 
DETAILS
Since this method is used to support both command line tools and other XDCscript scripts, it is important to avoid explicit termination of the JVM via java.lang.System.exit(); doing so precludes callers from handling failures.
Implementations should instead call
generated on Fri, 26 Jul 2013 17:01:59 GMT