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     *  ======== VC98.xdc ========
    14     */
    15    
    16    package microsoft.targets
    17    
    18    /*!
    19     *  ======== VC98.xdc ========
    20     *  Microsoft Windows 32-bit target using the Visual C/C++ 6.x compiler
    21     */
    22    
    23    metaonly module VC98 inherits microsoft.targets.ITarget {
    24    
    25        override readonly config string name                    = "VC98";   
    26        override readonly config string os                      = "Windows";
    27        override readonly config string suffix                  = "86";
    28        override readonly config string isa                     = "x86";    
    29        override readonly config xdc.bld.ITarget.Model model    = {
    30            endian: "little"
    31        };
    32    
    33        override readonly config string rts = "microsoft.targets.rts";
    34        override config string platform     = "host.platforms.PC";
    35        override config string execExt      = ".exe";
    36        
    37        /*!
    38         *  ======== path ========
    39         *  Path components added during execution of commands
    40         *
    41         *  The VC98 compiler DLLs are located in the vc98/bin subdirectory 
    42         *  the pdb DLL is located in $(rootDir)/msdev98/bin.
    43         */
    44        readonly config string path =
    45            "$(rootDir)/vc98/bin;$(rootDir)/common/msdev98/bin";
    46    
    47        /*!
    48         *  ======== ar ========
    49         *  The archiver command and all required options
    50         *  @p(dlist)
    51         *      -`-nologo`
    52         *          don't display archiver copyright
    53         */
    54        override readonly config ITarget.Command ar = {
    55            cmd: "$(rootDir)/vc98/bin/lib",
    56            opts: "-nologo"
    57        };
    58    
    59        /*!
    60         *  ======== cc ========
    61         *  The compile command and all required options
    62         *  @p(dlist)
    63         *      -`-W3`
    64         *          enable all warnings recommended for production purposes.
    65         *      -`-Zp1`
    66         *          Packs structure members on 1-byte boundry
    67         *      -`-c`
    68         *          don't link
    69         *      -`-nologo`
    70         *          don't display compiler copyright
    71         */
    72        override readonly config ITarget.Command cc = {
    73            cmd: "$(rootDir)/vc98/bin/cl.exe -nologo -c",
    74            opts: '-W3 -Zp1 -DWIN32 -D_DLL -D_AFXDLL -DEXPORT=""'
    75        };
    76    
    77        /*!
    78         *  ======== asm ========
    79         *  The assemble command and all required options
    80         *  @p(dlist)
    81         *      -`-c`
    82         *          don't link
    83         *      -`-nologo`
    84         *          don't display compiler copyright
    85         */
    86        override readonly config ITarget.Command asm = {
    87            cmd: "$(rootDir)/vc98/bin/cl.exe -nologo -c",
    88            opts: ""
    89        };
    90    
    91        /*!
    92         *  ======== lnk ========
    93         *  The linker command and all required options
    94         *  @p(dlist)
    95         *      -`-nologo`
    96         *          Don't display linker copyright
    97         */
    98        override readonly config ITarget.Command lnk = {
    99            cmd: "$(rootDir)/vc98/bin/link -nologo",
   100            opts: ""
   101        };
   102        
   103        /*!
   104         *  ======== ccOpts ========
   105         *  User modifiable default options.
   106         *  @p(dlist)
   107         *      -`-G5`
   108         *          Optimizes code to favor the Pentium processor
   109         *      -`-Ob1`
   110         *          Expand only functions marked as inline or, in a C++
   111         *          member function, defined within a class declaration
   112         *      -`-Gs`
   113         *          Probe stack to automatically grow stack as necessary
   114         *      -`-GX`
   115         *          Enables synchronous exception handling
   116         *      -`-WL`
   117         *          Write errors/warnings on a single output line
   118         */
   119        override config ITarget.Options ccOpts = {
   120            prefix: "-G5 -Ob1 -Gs -GX",
   121            suffix: "-Dfar= "
   122        };
   123    
   124        /*!
   125         *  ======== lnkOpts ========
   126         *  User modifiable linker options
   127         *  @p(dlist)
   128         *      -`-libpath`...
   129         *              directories to search for toolchain specific libraries
   130         *      -`-nodefaultlib`
   131         *              don't search for default libraries when linking; all
   132         *              libraries used must be explicitly named
   133         *      -`-incremental:no`
   134         *              link for execution (no subsequent link will occur)
   135         *      -`-machine:ix86`
   136         *              link for the Intel x86 architecture
   137         *      -`-map:$(XDCCFGDIR)/$@.map`
   138         *              output any link map information to the specified file
   139         *              ($(XDCCFGDIR) is usually package/cfg)
   140         *      -`-pdb:$(XDCCFGDIR)/$@.pdb`
   141         *              output any program debug information to the specified file
   142         *              ($(XDCCFGDIR) is usually package/cfg)
   143         */
   144        override config ITarget.Options lnkOpts = {
   145            prefix: "-libpath:$(rootDir)/vc98/lib -libpath:$(rootDir)/vc98/mfc/lib",
   146            suffix: "-map:$(XDCCFGDIR)/$@.map -pdb:$(XDCCFGDIR)/$@.pdb -machine:ix86 -nodefaultlib -incremental:no"
   147        };
   148            
   149        /*!
   150         *  ======== includeOpts ========
   151         *  User modifiable include paths
   152         *  @p(dlist)
   153         *      -`-I$(rootDir)/include`
   154         *          include compiler specific headers
   155         */
   156        override config string includeOpts = "-I$(rootDir)/vc98/include -I$(rootDir)/vc98/mfc/include -I$(rootDir)/vc98/atl/include";
   157    
   158    
   159        /*!
   160         *  ======== profiles ========
   161         *  User modifiable default profiles
   162         */
   163        override config xdc.bld.ITarget.OptionSet profiles[string] = [
   164            ["debug", {
   165                compileOpts: {
   166                    copts: "-Z7 -Odi -MTd",
   167                    defs:  "-D_DEBUG=1",
   168                },
   169                linkOpts: "-debug mfc42.lib mfcs42.lib msvcrt.lib msvcirt.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",
   170            }],
   171    
   172            ["release", {
   173                compileOpts: {
   174                    copts: "-O2 -MT",
   175                    defs:  "",
   176                },
   177                linkOpts: "mfc42.lib mfcs42.lib msvcrt.lib msvcirt.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",
   178            }],
   179        ];
   180    }
   181    /*
   182     *  @(#) microsoft.targets; 1, 0, 2, 0,391; 6-9-2010 16:19:56; /db/ztree/library/trees/xdctargets/xdctargets-b37x/src/
   183     */
   184