1    /* 
     2     *  Copyright (c) 2013 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     *
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     *
    11     * */
    12    /*!
    13     *  ======== Main ========
    14     *  Command-line configuration tool for IAR Embedded Workbench
    15     *
    16     *  This command-line tool computes the appropriate configuro options from the
    17     *  set of options passed from the IAR Workbench (for ex. target/platform
    18     *  from compile options). With these options, the xdc.tools.configuro tool
    19     *  is executed to compute the set of libraries, command-line flags and
    20     *  the other artifacts needed to build the application in IAR Workbench.
    21     *
    22     *  @a(INPUTS)
    23     *  @p(dlist)
    24     *    - `-o outdir (Optional)`
    25     *      Optionally a output directory can be provided.
    26     *    - `-c codegen_dir`
    27     *      Root directory of the code generation tools.
    28     *    - `--cc compiler_name_string`
    29     *      The name of the compiler.
    30     *    - `--cfgDir configfile_ dir`
    31     *      The directory that contains RTSC configuration file. Only one config
    32     *      file is expected to be in the directory.
    33     *    - `--device device_name_string`
    34     *      The name of the device.
    35     *    - `compileOptions compile_options_string`
    36     *      The command line options passed to the compiler. This should be the last 
    37     *      option. Any option after the compileOptions string is considered to be
    38     *      command line compile options.
    39     *  @p
    40     *
    41     *  @a(OUTPUTS)
    42     *  @p(dlist)
    43     *    - `outdir/`
    44     *      A directory containing all generated build artifacts.
    45     *    - `outdir/compiler.defs`
    46     *      A file containing C compiler command-line flags. These flags must
    47     *      included on the compiler command line for any C source file that
    48     *      directly accesses the RTSC content. The flags define the header file
    49     *      and include paths to ensure object code compatibility between all
    50     *      all included content.
    51     *    - `outdir/linker.cmd`
    52     *      A file containing linker command-line flags. These flags must be
    53     *      included on the linker command line for the final link of the
    54     *      application. The flags list needed libraries and object files,
    55     *      and on some platforms define the embedded system memory map.
    56     *  @p
    57     *
    58     *  For example:
    59     *  @p(code)
    60     *      xs iar.tools.configuro -c "<codegen_dir>" --cc "<compiler>"
    61     *         --cfgDir "<configfile_dir>" --device "<device_name>"
    62     *         compileOptions "<compiler_options>"
    63     *  @p
    64     */
    65    metaonly module Main inherits xdc.tools.ICmd {
    66    
    67        /*!
    68         * usage help message
    69         */
    70        override config String usage[] = [
    71            '[-o outdir (optional)]',
    72            '[-c codegen_dir]',
    73            '[--cc compiler_name_string]',
    74            '[--cfgDir configfile_dir]',
    75            '[--device device_name]',
    76            '[compileOptions compile_options_str (should be the last option]',
    77        ];
    78    
    79    instance:
    80        /*!
    81         *  ======== output ========
    82         *  Pathname of the output directory
    83         *
    84         *  A directory containing the generated build artifacts, in particular
    85         *  the `compiler.defs` and `linker.cmd` files.
    86         *
    87         *  The last component of the output directory path must be a valid
    88         *  ANSI C identifier; i.e., it must consist entirely of alphanumeric or
    89         *  '_' characters and must not start with a number.  So, the names
    90         *  '0app' and 'app-test' are not valid but '0app/config' and
    91         *  'app-test/config' are valid.
    92         *
    93         *  This is optional parameter. By default, the output directory has the
    94         *  name `configPkg` and will be  within the `{#cfgDir}` directory.
    95         */
    96        @CommandOption("o")
    97        config String output = null;
    98    
    99        /*!
   100         *  ======== rootDir ========
   101         *  Root directory of the code generation tools
   102         *
   103         *  The path to the installation directory of the compiler and linker
   104         *  for the selected target. The definition of "installation directory"
   105         *  can vary from compiler to compiler, but is most commonly the
   106         *  directory that contains a "bin" subdirectory.
   107         */
   108        @CommandOption("c")
   109        config String rootDir = null;
   110    
   111        /*!
   112         *  ======== compiler ========
   113         *  The name of the compiler
   114         *
   115         *  The compiler name is required to find the target and platform
   116         *  xdc.tools.configuro options.
   117         */
   118        @CommandOption("cc")
   119        config String compiler = null;
   120    
   121        /*!
   122         *  ======== cfgDir ========
   123         *  Root directory containing the configuration file.
   124         *
   125         *  The directory is searched for configuration file (with extension .cfg).
   126         *  The directory should contain only one configuration file. In case of
   127         *  multiple configuration files, only the first configuration file in
   128         *  the alphabetical order will be passed to xdc.tools.configuro.
   129         */
   130        @CommandOption("cfgDir")
   131        config String cfgDir = null;
   132        
   133        /*!
   134         *  ======== device ========
   135         *  The name of the device
   136         *
   137         *  The device name has to be passed to the xdc.tools.configuro tool.
   138         */
   139        @CommandOption("device")
   140        config String device = null;
   141        
   142        /*!
   143         *  ======== compileOptions ========
   144         *  Compile options used for building C files
   145         *
   146         *  The compiler options are required to find the target and platform
   147         *  options for xdc.tools.configuro. 
   148         */
   149        config String compileOptions = null;
   150    }
   151    /*
   152     *  @(#) iar.tools.configuro; 1, 0, 0,7; 7-9-2013 12:05:56; /db/ztree/library/trees/xdctools/xdctools-f32x/src/
   153     */
   154