1 2 3 4 5 6 7 8 9 10 11
12 13 14
15 package microsoft.targets;
16
17 /*!
18 * ======== Net32 ========
19 * Microsoft .Net 32-bit native target
20 *
21 * This target supports the free Microsoft .Net C/C++ compiler; aka the
22 * Microsoft Visual C++ Toolkit 2003 available from
23 * http://msdn.microsoft.com/visualc/vctoolkit2003.
24 */
25 metaonly module Net32 inherits microsoft.targets.ITarget {
26
27 override readonly config string name = "Net32";
28 override readonly config string os = "Windows";
29 override readonly config string suffix = "86N";
30 override readonly config string isa = "x86";
31 override readonly config xdc.bld.ITarget.Model model = {
32 endian: "little"
33 };
34
35 /*!
36 * ======== profiles ========
37 * User modifiable default profiles
38 */
39 override config xdc.bld.ITarget.OptionSet profiles[string] = [
40 ["debug", {
41 compileOpts: {
42 copts: "-Z7 -Od -MTd",
43 defs: "-D_DEBUG=1",
44 },
45 linkOpts: "libcmt.lib kernel32.lib",
46 }],
47
48 ["release", {
49 compileOpts: {
50 copts: "-Oxi -MT",
51 },
52 linkOpts: "libcmt.lib kernel32.lib",
53 }],
54 ];
55
56 override readonly config string rts = "microsoft.targets.rts";
57 override config string platform = "host.platforms.PC";
58 override config string execExt = ".exe";
59
60 /*!
61 * ======== ar ========
62 * The archiver command and all required options
63 * @p(dlist)
64 * -`-nologo`
65 * don't display archiver copyright
66 */
67 override readonly config xdc.bld.ITarget2.Command ar = {
68 cmd: "$(rootDir)/bin/link.exe -lib -nologo",
69 opts: ""
70 };
71
72 /*!
73 * ======== cc ========
74 * The compile command and all required options
75 * @p(dlist)
76 * -`-c`
77 * don't link
78 * -`-nologo`
79 * don't display compiler copyright
80 */
81 override readonly config xdc.bld.ITarget2.Command cc = {
82 cmd: "$(rootDir)/bin/cl",
83 opts: "-nologo -c",
84 };
85
86 /*!
87 * ======== asm ========
88 * The assemble command and all required options
89 * @p(dlist)
90 * -`-c`
91 * don't link
92 */
93 override readonly config xdc.bld.ITarget2.Command asm = {
94 cmd: "$(rootDir)/bin/cl",
95 opts: "-nologo -c",
96 };
97
98 /*!
99 * ======== lnk ========
100 * The linker command and all required options
101 * @p(dlist)
102 * -`-nologo`
103 * Don't display linker copyright
104 */
105 override readonly config xdc.bld.ITarget2.Command lnk = {
106 cmd: "$(rootDir)/bin/link -nologo",
107 opts: ""
108 };
109
110 /*!
111 * ======== ccOpts ========
112 * User modifiable default options.
113 * @p(dlist)
114 * -`-G5`
115 * Optimizes code to favor the Pentium processor
116 * -`-W3`
117 * enable all warnings recommended for production purposes.
118 */
119 override config xdc.bld.ITarget2.Options ccOpts = {
120 prefix: "-G5 -W3",
121 };
122
123 /*!
124 * ======== lnkOpts ========
125 * User modifiable linker options
126 * @p(dlist)
127 * -`-libpath`...
128 * directories to search for toolchain specific libraries
129 * -`-nodefaultlib`
130 * don't search for default libraries when linking; all
131 * libraries used must be explicitly named
132 * -`-incremental:no`
133 * link for execution (no subsequent link will occur)
134 * -`-machine:ix86`
135 * link for the Intel x86 architecture
136 * -`-map:$(XDCCFGDIR)/$@.map`
137 * output any link map information to the specified file
138 * ($(XDCCFGDIR) is usually package/cfg)
139 * -`-pdb:$(XDCCFGDIR)/$@.pdb`
140 * output any program debug information to the specified file
141 * ($(XDCCFGDIR) is usually package/cfg)
142 */
143 override config xdc.bld.ITarget2.Options lnkOpts = {
144 prefix: "-libpath:$(rootDir)/lib",
145 suffix: "-map:$(XDCCFGDIR)/$@.map -pdb:$(XDCCFGDIR)/$@.pdb -mapinfo:exports -machine:ix86 -nodefaultlib -incremental:no"
146 };
147
148 /*!
149 * ======== includeOpts ========
150 * User modifiable default include directories
151 * @p(dlist)
152 * -`-I$(rootDir)/include`
153 * include compiler specific headers
154 */
155 override config string includeOpts = "-I$(rootDir)/include";
156 }
157 158 159 160
161