1    /* 
     2     *  Copyright (c) 2008 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.xdc ========
    14     */
    15    package microsoft.targets;
    16    
    17    /*!
    18     *  ======== ITarget ========
    19     *  A Microsoft-specific extension to the base xdc.bld.ITarget2 interface.
    20     */
    21    @TargetHeader("xdc/bld/stddefs.xdt")
    22    metaonly interface ITarget inherits xdc.bld.ITarget2 {
    23    
    24        override readonly config string stdInclude = "microsoft/targets/std.h";
    25        override config string dllExt     = ".dll";
    26    
    27        /*!
    28         *  ======== debugGen ========
    29         *  Debugger/IDE project file generation support.
    30         * 
    31         *  The settings below generate VC project files that enable one
    32         *  to debug (and even rebuild) Executables from within the VC GUI.
    33         *
    34         *  To avoid unnecessary build time overhead, these files are not always
    35         *  generated; by default, they are only generated for "debug" profiles.
    36         *  The generation of these files is controlled by the
    37         *  `{@link xdc.cfg.Program#gen}` configuration parameter.  To force these
    38         *  files to be generated for a particular executable, add the following
    39         *  line to the executable's program configuration script:
    40         *  @p(code)
    41         *      Program.gen.debuggerFiles = true;
    42         *  @p
    43         *  It is also possible to control the generation via build options; see
    44         *  `{@link xdc.bld.ITarget#DebugGen}`.
    45         *
    46         *  To debug an executable: double click on the generated *.vcproj file,
    47         *      when the debugger comes up, type F11 (step into).
    48         *
    49         *  The first time you debug an executable, the VC debugger may prompt
    50         *  you for a "solution file" to save.  Click OK (accepting the solution
    51         *  file name), and you will be at the first statement of your
    52         *  executable.
    53         *
    54         *  To set command line arguments prior to debugging: open the
    55         *  executable's "Project Properties" dialog (select the
    56         *  executable in the "Solution Explorer" window and pull-down
    57         *  View->"Property Pages" or type shift-F4), select "Debugging"
    58         *  in the left-most pane of the executable's "Property Pages", and
    59         *  enter command line arguments in the "Command Arguments" text box.
    60         *
    61         *  @see  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vxtskdebugginganexecreatedwithoutvisualstudioproject.asp
    62         */
    63        override config xdc.bld.ITarget.DebugGen debugGen = {
    64            execTemplate: "microsoft/targets/vc_exec.xdt",
    65            execPattern: "$(cfgName).vcproj"
    66        };
    67    
    68        /*!
    69         *  ======== profiles ========
    70         *  Standard options profiles for the microsoft tool-chain.
    71         */
    72        override config xdc.bld.ITarget.OptionSet profiles[string] = [
    73            ["debug", {
    74                compileOpts: {
    75                    copts: "-Z7 -Odi -MTd",
    76                    defs:  "-D_DEBUG=1",
    77                },
    78                linkOpts: "-debug msvcrt.lib setargv.obj oldnames.lib ole32.lib oleaut32.lib olepro32.lib uuid.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib comctl32.lib",
    79            }],
    80    
    81            ["release", {
    82                compileOpts: {
    83                    copts: "-O2 -MT",
    84                    defs:  "",
    85                },
    86                linkOpts: "msvcrt.lib setargv.obj oldnames.lib ole32.lib oleaut32.lib olepro32.lib uuid.lib kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib comctl32.lib",
    87            }],
    88        ];
    89    
    90        /*!
    91         *  ======== setPath ========
    92         *  Return path needed to find necessary DLLS
    93         *
    94         *  The microsoft compilers often require one or more directories to
    95         *  be in the PATH; this allows the compiler to find necessary DLLs.
    96         *  A target implementing this function returns a string with path
    97         *  components separated by ";".
    98         */
    99        function setPath();
   100    
   101        /*!
   102         *  ======== cmdPrefix ========
   103         *  Prefix to put in front of each command
   104         *
   105         *  This string is put in front of every Command before being passed to
   106         *  the shell for execution.  This string can be used to run the compiler
   107         *  in emulation environments.  
   108         */
   109        config String cmdPrefix = "";
   110        
   111        /*!
   112         *  ======== strictANSI ========
   113         *  Disable Microsoft C/C++ language extensions
   114         *
   115         *  Set to true if you plan to port your program to other environments.
   116         *  The compiler treats extended keywords as simple identifiers, disables
   117         *  the other Microsoft extensions, and automatically defines the
   118         *  `__STDC__` predefined macro for C programs. This option shows up
   119         *  as `"-Za"` on the command line when strictANSI is set to `true`.
   120         */
   121        config bool strictANSI = true;
   122        
   123        /*!
   124         *  ======== version ========
   125         *  The Compatibility Key associated with this target.
   126         *
   127         *  The first two components of this target Compatibility Key are '1,0'.
   128         *  The rest of the Key represents the compiler version. The third
   129         *  component combines the major and the minor version number in the format
   130         *  Major.Minor. The fourth component is the build number.
   131         *
   132         *  @a(Example)
   133         *  If this target's `rootDir` points to the Visual C++ 2005 Express 
   134         *  Edition, the output of the command `cl` may contains the compiler
   135         *  version string 14.00.50727.42. The Compatibility Key is
   136         *  [1,0,14.00,50727].
   137         *  
   138         */
   139        override metaonly config String version;
   140    
   141        /*!
   142         *  ======== stdTypes ========
   143         *  @_nodoc
   144         */
   145        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   146            t_IArg          : { size: 4, align: 1 },
   147            t_Char          : { size: 1, align: 1 },
   148            t_Double        : { size: 8, align: 1 },
   149            t_Float         : { size: 4, align: 1 },
   150            t_Fxn           : { size: 4, align: 1 },
   151            t_Int           : { size: 4, align: 1 },
   152            t_Int8          : { size: 1, align: 1 },
   153            t_Int16         : { size: 2, align: 1 },
   154            t_Int32         : { size: 4, align: 1 },
   155            t_Int64         : { size: 8, align: 1 },
   156            t_Long          : { size: 4, align: 1 },
   157            t_LDouble       : { size: 8, align: 1 },
   158            t_Ptr           : { size: 4, align: 1 },
   159            t_Short         : { size: 2, align: 1 },
   160        };
   161    }
   162    /*
   163     *  @(#) microsoft.targets; 1, 0, 2, 0,401; 8-4-2010 16:21:09; /db/ztree/library/trees/xdctargets/xdctargets-c27x/src/
   164     */
   165