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    /*
    14     *  ======== WinCE.xdc ========
    15     */
    16    
    17    package microsoft.targets.arm;
    18    
    19    /*!
    20     *  ======== WinCE.xdc ========
    21     *  Microsoft Windows Embedded "target" using the ARM compiler.
    22     */
    23    
    24    metaonly module WinCE inherits microsoft.targets.ITarget {
    25    
    26        override readonly config string name                    = "WinCE";
    27        override readonly config string os                      = "WindowsCE";
    28        override readonly config string suffix                  = "v4TCE";
    29        override readonly config string isa                     = "v4T";
    30        override readonly config xdc.bld.ITarget.Model model    = {
    31            endian: "little"
    32        };
    33    
    34        override readonly config string stdInclude = "microsoft/targets/arm/std.h";
    35        override readonly config string rts     = "microsoft.targets.arm.rts";
    36    /* readonly */    override config string platform   = "host.platforms.arm";
    37    /* readonly */    override config string execExt    = ".exe";
    38        override config bool strictANSI  = false;
    39        
    40        /*!
    41         *  ======== remoteInitScript ========
    42         *  @_nodoc
    43         *  Environment initialization script.
    44         *
    45         *  When a WinCE compiler is invoked remotely, a script that initializes
    46         *  various environment variables must be run first.
    47         */
    48        config string remoteInitScript;
    49    
    50        /*!
    51         *  ======== projectRoot ========
    52         *  Path to the project root of the selected OS configuration.
    53         *
    54         *  This parameter specifies the absolute path to the root of an OS
    55         *  configuration within an OS design. OS configurations are located in 
    56         *  the subdirectory 'Wince600' of your OS design directory. Each 
    57         *  project root contains the batch file `PBInitEnv.bat`.
    58         *  This parameter determines where this target is searching for OS 
    59         *  modules when linking an application.
    60         */
    61        config string projectRoot;
    62    
    63        /*!
    64         *  ======== sysGenIsa ========
    65         *  @_nodoc
    66         *  Selected Arm architecture.
    67         *
    68         *  This parameter defaults to ARMV4I.
    69         */
    70        config string sysGenIsa = "ARMV4I";
    71    
    72       /*!
    73        *  ======== EntryPoint ========
    74        *  Entry point options
    75        */
    76        enum EntryPoint {
    77            UNDEFINED,         /*! -entry option is user specified */
    78            mainCRTStartup,    /*! for apps using SUBSYSTEM:CONSOLE, calls main */
    79            WinMainCRTStartup, /*! for SUBSYSTEM:WINDOWS, calls WinMain */
    80            _DllMainCRTStartup /*! for DLLS, calls DllMain */
    81        };
    82    
    83       /*!
    84        *  ======== entryPoint ========
    85        *  Define which function is called at startup
    86        */
    87        config EntryPoint entryPoint = mainCRTStartup;
    88    
    89        /*!
    90         *  ======== path ========
    91         *  Path components added during execution of commands.
    92         *
    93         *  The WinCE compiler DLLs are located in ?? subdirectory?
    94         *  The pdb DLL is located in ?? directory?
    95         */
    96        readonly config string path =
    97            "$(rootDir)/sdk/bin/i386;$(rootDir)/sdk/bin/i386/arm";
    98    
    99        /*!
   100         *  ======== ar ========
   101         *  The archiver command and all required options.
   102         *
   103         *  4001 warning warns that there are only libraries being supplied.
   104         */
   105        override readonly config xdc.bld.ITarget2.Command ar = {
   106            cmd: "$(rootDir)/sdk/bin/i386/arm/link.exe -lib -nologo",
   107            opts: "-ignore:4001"
   108        };
   109    
   110        /*!
   111         *  ======== cc ========
   112         *  The compile command and all required options.
   113         */
   114        override readonly config xdc.bld.ITarget2.Command cc = {
   115            cmd: "$(rootDir)/sdk/bin/i386/arm/cl.exe -nologo -c",
   116            opts: "-Gy -GF -D_CRT_SECURE_NO_DEPRECATE -D_USE_32BIT_TIME_T -DUNICODE  -D_UNICODE -DUNDER_CE=600 -D_WIN32_WCE=0x600 -DWIN32 -DSTRICT -DARM -DARMV4I  -D_ARM_ -DINTERNATIONAL -DINTLMSG_CODEPAGE=1252 -Zc:wchar_t- -Zc:forScope- -wd4867 -wd4430 -MT -U_MT -W3 /GR- -QRarch4T -DTHUMBSUPPORT -QRimplicit-import- -QRinterwork-return /GS"
   117        };
   118    
   119        /*!
   120         *  ======== asm ========
   121         *  The assemble command and all required options.
   122         */
   123        override readonly config xdc.bld.ITarget2.Command asm = {
   124            cmd: "$(rootDir)/sdk/bin/i386/arm/armasm.exe -nologo",
   125            opts: "-arch 4T"
   126        };
   127    
   128        /*!
   129         *  ======== lnk ========
   130         *  The linker command and all required options.
   131         */
   132        override readonly config xdc.bld.ITarget2.Command lnk = {
   133            cmd: "$(rootDir)/sdk/bin/i386/arm/link -nologo",
   134            opts: "-base:0x00010000 -MERGE:.rdata=.text -MERGE:.astart=.text -align:4096 -ignore:4001,4070,4078,4086,4089,4096,4099,4108,4229 /STACK:65536,4096 /LARGEADDRESSAWARE -incremental:no /opt:ref -SUBSYSTEM:WINDOWSCE,6.00"
   135        };
   136    
   137        /*!
   138         *  ======== ccOpts ========
   139         *  User modifiable default options.
   140         */
   141        override config xdc.bld.ITarget2.Options ccOpts = {
   142            prefix: "",
   143            suffix: ""
   144        };
   145    
   146        /*!
   147         *  ======== includeOpts ========
   148         *  User modifiable include paths.
   149         */
   150        override config string includeOpts = " ";
   151    
   152        /*!
   153         *  ======== lnkOpts ========
   154         *  User modifiable linker options.
   155         */
   156        override config xdc.bld.ITarget2.Options lnkOpts = {
   157            prefix: "-stack:65536,4096",
   158            suffix: "-map:$(XDCCFGDIR)/$@.map -pdb:$(XDCCFGDIR)/$@.pdb -nodefaultlib"
   159        };
   160    
   161        /*!
   162         *  ======== profiles ========
   163         *  User modifiable default profiles.
   164         */
   165        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   166            ["debug", {
   167                compileOpts: {
   168                    copts: "-Od -Z7",
   169                    defs:  "-D_DEBUG, -DDEBUG",
   170                },
   171                linkOpts: "-debug -debugtype:cv,fixup coredll.lib corelibc.lib",
   172            }],
   173            ["release", {
   174                compileOpts: {
   175                    copts: "-O2",
   176                    defs:  "-DNDEBUG=1",
   177                },
   178                linkOpts: "coredll.lib corelibc.lib",
   179            }],
   180        ];
   181    }
   182    
   183    /*
   184     *  @(#) microsoft.targets.arm; 1, 0, 0, 0,156; 9-15-2010 15:03:15; /db/ztree/library/trees/xdctargets/xdctargets-c28x/src/ xlibrary
   185    
   186     */
   187