Added ChangeLog entry
[mono.git] / man / mcs.1
1 .TH mcs 1 "6 January 2001"
2 .SH NAME 
3 mcs \- Mono Compiler Suite.
4 .SH SYNOPSIS
5 .B mcs 
6 [option] [source-files]
7 .SH DESCRIPTION
8 mcs is the Mono C# compiler, an implementation of the ECMA-334
9 language specification.  You can pass one or more options to drive the
10 compiler, and a set of source files.  Extra options or arguments can
11 be provided in a response file.  Response files are referenced by
12 prepending the @ symbol to the response file name.
13 .PP
14 The Mono C# compiler accepts the same options than the Microsoft C#
15 compiler does.  Those options can start with a slash or a dash
16 (/checked is the same as -checked).  Additionally to this, the
17 GNU-like options are supported, those begin with "--".  All
18 MCS-specific flags which are not available in the Microsoft C#
19 compiler are available only with the GNU-style options. 
20 .PP
21 C# source files must end with a ".cs" extension.  Compilation of C#
22 source code requires all the files that make up a library, module or
23 executable to be provided on the command line.  There is no support
24 for partial compilation.  To achieve the benefits of partial
25 compilation, you should compile programs into their own assemblies,
26 and later reference them with the "-r" flag.
27 .PP
28 The Mono C# compiler generates images (.exe files) that contain CIL
29 byte code that can be executed by any system that implements a Common
30 Language Infrastructure virtual machine such as the Microsoft .NET
31 runtime engine on Windows or the Mono runtime engine on Unix systems.
32 Executables are not bound to a specific CPU or operating system.
33 .PP
34 .SH OPTIONS
35 .TP
36 .I \-\-about
37 Displays information about the Mono C# compiler
38 .TP
39 .I -checked, -checked+
40 Sets the default compilation mode to `checked'.  This makes all
41 the math operations checked (the default is unchecked).
42 .TP
43 .I -checked-
44 Sets the default compilation mode to `unchecked'.  This makes all
45 the math operations unchecked (this is the default).
46 .TP
47 .I -codepage:ID
48 Specifies the code page used to process the input files from the
49 point it is specified on.  By default files will be processed in the
50 Latin-1 code page.  The compiler will also automatically detect
51 Unicode files that have an embedded byte mark at the beginning.   The
52 special ID "utf8" can be used to switch to utf8 and the ID "reset"
53 restores the automatic handling of code pages.
54 .TP
55 .I \-define:SYMLIST, -d:SYMLIST
56 Defines the symbol listed by the semi-colon separeted list SYMLIST
57 SYMBOL.  This can be tested in the source code by the pre-processor,
58 or can be used by methods that have been tagged with the Conditional
59 attribute. 
60 .TP
61 .I \-debug, \-debug+, \-g
62 Generate debugging information.  To obtain stack traces with debugging
63 information, you need to invoke the mono runtime with the `--debug'
64 flag.  This debugging information is stored inside the assembly as a
65 resource.
66 .TP
67 .I \-debug-
68 Do not generate debugging information.
69 .TP
70 .I \-\-expect-error X L
71 The compiler will expect the code to generate an error 
72 named `X' in line `L'.  This is only used by the test suite.
73 .TP 
74 .I \-\-fatal 
75 This is used for debugging the compiler.  This makes the error emission
76 generate an exception that can be caught by a debugger.
77 .TP
78 .I \-\-stacktrace
79 Generates a stack trace at the time the error is reported, useful for
80 debugging the compiler.
81 .TP
82 .I -lib:PATHLIST
83 Each path specified in the comma-separated list will direct the
84 compiler to look for libraries in that specified path.
85 .TP
86 .I \-L PATH
87 Directs the compiler to look for libraries in the specified path.
88 Multiple paths can be provided by using the option multiple times.
89 .TP
90 .I \-nostdlib, -nostdlib+
91 Use this flag if you want to compile the core library.  This makes the
92 compiler load its internal types from the assembly being compiled.
93 .TP
94 .I \-noconfig, \-noconfig+
95 Disables the default compiler configuration to be loaded.  The
96 compiler by default has references to the system assemblies. 
97 .TP
98 .I \-nowarn:WARNLIST
99 Makes the compiler ignore warnings specified in the comma-separeted
100 list WARNLIST>
101 .TP
102 .I -out:FNAME, -o FNAME
103 Names the output file to be generated.
104 .TP
105 .I \-\-parse
106 Used for benchmarking.  The compiler will only parse its input files.
107 .TP
108 .I -resource:RESOURCE[,ID]
109 Embeds to the given resource file.  The optional ID can be used to
110 give a different name to the resource.  If not specified, the resource
111 name will be the file name.
112 .TP
113 .I -linkresource:RESOURCE[,ID]
114 Links to the specified RESOURCE.  The optional ID can be used to give
115 a name to the linked resource.
116 .TP
117 .I \-recurse:PATTERN, --recurse PATTERN
118 Does recursive compilation using the specified pattern.  In Unix the
119 shell will perform globbing, so you migth want to use it like this:
120 .PP
121 .nf
122                 bash$ mcs -recurse:'*.cs' 
123 .fi
124 .TP
125 .I \-target:KIND, \-t:KIND
126 Used to specify the desired target.  The possible values are: exe,
127 winexe, library and module.  
128 .TP
129 .I \-\-timestamp
130 Another debugging flag.  Used to display the times at various points
131 in the compilation process.
132 .TP
133 .I \-unsafe, -unsafe+
134 Enables compilation of unsafe code.
135 .TP
136 .I \-warnaserror, \-warnaserror+
137 Treat warnings as errors.
138 .TP
139 .I \-warn:LEVEL
140 Sets the warning level.  0 is the lowest warning level, and 4 is the
141 highest.  The default is 2.
142 .TP
143 .I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
144 Reference the named assemblies.  Use this to use classes from the named
145 assembly in your program.  The assembly will be loaded from either the
146 system directory where all the assemblies live, or from the path
147 explicitly given with the -L option.
148 .PP
149 You can also use a semicolon to separate the assemblies instead of a
150 comma. 
151 .TP
152 .I \-v 
153 Debugging. Turns on verbose yacc parsing.
154 .TP
155 .I \-v2
156 Turns on C# 2.0 language features.
157 .TP
158 .I \-\-version
159 Shows the compiler version.
160 .TP
161 .I \-\-
162 Use this to stop option parsing, and allow option-looking parameters
163 to be passed on the command line.
164 .PP
165 .SH SPECIAL DEFINES
166 The 
167 .B TRACE
168 and
169 .B DEBUG
170 defines have a special meaning to the compiler.
171 .PP
172 By default calls to methods and properties in the
173 System.Diagnostics.Trace class are not generated unless the TRACE
174 symbol is defined (either through a "#define TRACE") in your source
175 code, or by using the
176 .I "--define TRACE"
177 in the command line.
178 .PP
179 By default calls to methods and properties in the
180 System.Diagnostics.Debug class are not generated unless the DEBUG
181 symbol is defined (either through a "#define DEBUG") in your source
182 code, or by using the
183 .I "--define DEBUG"
184 in the command line.
185 .PP
186 Note that the effect of defining TRACE and DEBUG is a global setting,
187 even if they are only defined in a single file.
188 .PP
189 .SH DEBUGGING SUPPORT
190 When use the "--debug" or "-g" flag, MCS will create an assembler file
191 FILE-debug.s containing debugging information where FILE is the name of
192 the generated assembly. You need to run this file through the assembler
193 to get a object file FILE-debug.o.  See mono's "--dwarf-plus" argument
194 for details on how to use this file.
195 .SH NOTES
196 During compilation the MCS compiler defines the __MonoCS__ symbol,
197 this can be used by pre-processor instructions to compile Mono C#
198 compiler specific code.
199 .SH AUTHORS
200 The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap and
201 Martin Baulig at Ximian.
202 .PP
203 .SH LICENSE
204 The Mono Compiler Suite is released under the terms of the GNU GPL.
205 Please read the accompanying `COPYING' file for details.  Alternative
206 licenses are available from Ximian.
207 .PP
208 .SH SEE ALSO
209 mono(1), mint(1)
210 .PP
211 .SH BUGS
212 To report bugs in the compiler, you can use `bug-buddy', or you can
213 file bug reports in our bug tracking system:
214 http://bugzilla.ximian.com.
215 .SH MAILING LIST
216 The Mono Mailing List is available at: mono-list-request@ximian.com
217 .SH MORE INFORMATION
218 The Mono C# compiler is developed by Ximian, Inc
219 (http://www.ximian.com) (http://www.ximian.com) and is based on the
220 ECMA C# language standard available here:
221 http://www.ecma.ch/ecma1/STAND/ecma-334.htm
222
223