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     *  ======== ITarget ========
    14     *  IAR ARM extension to the base `xdc.bld.ITarget3` interface.
    15     */
    16    @TargetHeader("xdc/bld/stddefs.xdt")
    17    metaonly interface ITarget inherits xdc.bld.ITarget3 {
    18    
    19        override readonly config String rts = "iar.targets.arm.rts";
    20    
    21        override config string stdInclude = "iar/targets/arm/std.h";
    22    
    23        /*
    24         *  ======== binDir ========
    25         *  Code gen tools bin directory path
    26         */
    27        config string binDir = "$(rootDir)/bin/";
    28    
    29        /*!
    30         *  ======== ccOpts ========
    31         *  User configurable compiler options.
    32         */
    33        override config Options ccOpts = {
    34            prefix: "--silent",
    35            suffix: ""
    36        };
    37    
    38        /*!
    39         *  ======== asmOpts ========
    40         *  User configurable assembler options.
    41         */
    42        override config Options asmOpts = {
    43            prefix: "-S",
    44            suffix: ""
    45        };
    46    
    47        /*!
    48         *  ======== ar ========
    49         *  The command used to create an archive
    50         */
    51        override readonly config Command ar = {
    52            cmd: "iarchive",
    53            opts: ""
    54        };
    55    
    56        /*!
    57         *  ======== arOpts ========
    58         *  User configurable archiver options.
    59         */
    60        override config Options arOpts = {
    61            prefix: "--silent",
    62            suffix: ""
    63        };
    64    
    65        /*!
    66         *  ======== lnkOpts ========
    67         *  User configurable linker options.
    68         */
    69        override config xdc.bld.ITarget2.Options lnkOpts = {
    70            prefix: "--silent",
    71            suffix: "--map $(XDCCFGDIR)/$@.map  --redirect _Printf=_PrintfSmall --redirect _Scanf=_ScanfSmall --entry __iar_program_start",
    72        };
    73    
    74        /*!
    75         *  ======== vers ========
    76         *  The command used to get the tool-chain to return a version number.
    77         */
    78        readonly config Command vers = {
    79            cmd: "iccarm",
    80            opts: "-v"
    81        };
    82    
    83        /*!
    84         *  ======== extension ========
    85         *  The IAR assembly file extension recognised by this target.
    86         */
    87        override config Extension extensions[string] = [
    88            [".asm", {suf: ".asm", typ: "asm"}],
    89            [".c",   {suf: ".c",   typ: "c"  }],
    90            [".cpp", {suf: ".cpp", typ: "cpp"}],
    91            [".cxx", {suf: ".cxx", typ: "cpp"}],
    92            [".C",   {suf: ".C",   typ: "cpp"}],
    93            [".cc",  {suf: ".cc",  typ: "cpp"}],
    94            [".s",   {suf: ".s",   typ: "asm"}],
    95        ];
    96    
    97        /*!
    98         *  ======== includeOpts ========
    99         *  Additional user configurable target-specific include path options
   100         */
   101        override config String includeOpts = "";
   102    
   103        /*!
   104         *  ======== cmdPrefix ========
   105         *  Prefix to put in front of each command
   106         *
   107         *  This string is put in front of every Command before being passed to
   108         *  the shell for execution.  This string can be used to run the compiler
   109         *  in emulation environments. 
   110         *
   111         *  LC_ALL=C must be set for code gen to run on SUSE
   112         */
   113        config String cmdPrefix = "LC_ALL=C ";
   114    
   115        /*!
   116         *  ======== alignDirectiveSupported ========
   117         *  The compiler supports an align directive.
   118         */
   119        override readonly config Bool alignDirectiveSupported = true;
   120    
   121        /*!
   122         *  ======== stdTypes  ========
   123         *  Size and alignment for standard base types
   124         */
   125        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   126            t_IArg          : { size: 4, align: 4 },
   127            t_Char          : { size: 1, align: 1 },
   128            t_Double        : { size: 8, align: 8 },
   129            t_Float         : { size: 4, align: 4 },
   130            t_Fxn           : { size: 4, align: 4 },
   131            t_Int           : { size: 4, align: 4 },
   132            t_Int8          : { size: 1, align: 1 },
   133            t_Int16         : { size: 2, align: 2 },
   134            t_Int32         : { size: 4, align: 4 },
   135            t_Long          : { size: 4, align: 4 },
   136            t_LDouble       : { size: 8, align: 8 },
   137            t_LLong         : { size: 8, align: 8 },
   138            t_Ptr           : { size: 4, align: 4 },
   139            t_Short         : { size: 2, align: 2 },
   140            t_Size          : { size: 4, align: 4 },
   141            t_Int64         : { size: 8, align: 8 },
   142        };
   143    }
   144    /*
   145     *  @(#) iar.targets.arm; 1, 0, 0,16; 6-10-2013 15:17:26; /db/ztree/library/trees/xdctargets/xdctargets-g30x/src/ xlibrary
   146    
   147     */
   148