Mon Nov 18 17:52:56 CET 2002 Paolo Molaro <lupus@ximian.com>
[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.  The debugging information is stored
63 in a file with the extension .dbg (if you install system wide
64 assemblies, you need to install this file as well).  To get stack
65 traces with debugging information, you need to invoke the mono runtime
66 with the `--debug' flag.  
67 .TP
68 .I \-debug-
69 Do not generate debugging information.
70 .TP
71 .I \-\-expect-error X L
72 The compiler will expect the code to generate an error 
73 named `X' in line `L'.  This is only used by the test suite.
74 .TP 
75 .I \-\-fatal 
76 This is used for debugging the compiler.  This makes the error emission
77 generate an exception that can be caught by a debugger.
78 .TP
79 .I \-\-stacktrace
80 Generates a stack trace at the time the error is reported, useful for
81 debugging the compiler.
82 .TP
83 .I -lib:PATHLIST
84 Each path specified in the comma-separated list will direct the
85 compiler to look for libraries in that specified path.
86 .TP
87 .I \-L PATH
88 Directs the compiler to look for libraries in the specified path.
89 Multiple paths can be provided by using the option multiple times.
90 .TP
91 .I \-nostdlib, -nostdlib+
92 Use this flag if you want to compile the core library.  This makes the
93 compiler load its internal types from the assembly being compiled.
94 .TP
95 .I \-noconfig, \-noconfig+
96 Disables the default compiler configuration to be loaded.  The
97 compiler by default has references to the system assemblies. 
98 .TP
99 .I \-nowarn:WARNLIST
100 Makes the compiler ignore warnings specified in the comma-separeted
101 list WARNLIST>
102 .TP
103 .I -out:FNAME, -o FNAME
104 Names the output file to be generated.
105 .TP
106 .I \-\-parse
107 Used for benchmarking.  The compiler will only parse its input files.
108 .TP
109 .I -resource:RESOURCE[,ID]
110 Embeds to the given resource file.  The optional ID can be used to
111 give a different name to the resource.  If not specified, the resource
112 name will be the file name.
113 .TP
114 .I -linkresource:RESOURCE[,ID]
115 Links to the specified RESOURCE.  The optional ID can be used to give
116 a name to the linked resource.
117 .TP
118 .I \-recurse:PATTERN, --recurse PATTERN
119 Does recursive compilation using the specified pattern.  In Unix the
120 shell will perform globbing, so you migth want to use it like this:
121 .PP
122 .nf
123                 bash$ mcs -recurse:'*.cs' 
124 .fi
125 .TP
126 .I \-target:KIND, \-t:KIND
127 Used to specify the desired target.  The possible values are: exe,
128 winexe, library and module.  
129 .TP
130 .I \-\-timestamp
131 Another debugging flag.  Used to display the times at various points
132 in the compilation process.
133 .TP
134 .I \-unsafe, -unsafe+
135 Enables compilation of unsafe code.
136 .TP
137 .I \-warnaserror, \-warnaserror+
138 Treat warnings as errors.
139 .TP
140 .I \-warn:LEVEL
141 Sets the warning level.  0 is the lowest warning level, and 4 is the
142 highest.  The default is 2.
143 .TP
144 .I -r:ASSEMBLY1[,ASSEMBLY2], \-r ASSEMBLY1[,ASSEMBLY2]
145 Reference the named assemblies.  Use this to use classes from the named
146 assembly in your program.  The assembly will be loaded from either the
147 system directory where all the assemblies live, or from the path
148 explicitly given with the -L option.
149 .PP
150 You can also use a semicolon to separate the assemblies instead of a
151 comma. 
152 .TP
153 .I \-v 
154 Debugging. Turns on verbose yacc parsing.
155 .TP
156 .I \-\-
157 Use this to stop option parsing, and allow option-looking parameters
158 to be passed on the command line.
159 .PP
160 .SH SPECIAL DEFINES
161 The 
162 .B TRACE
163 and
164 .B DEBUG
165 defines have a special meaning to the compiler.
166 .PP
167 By default calls to methods and properties in the
168 System.Diagnostics.Trace class are not generated unless the TRACE
169 symbol is defined (either through a "#define TRACE") in your source
170 code, or by using the
171 .I "--define TRACE"
172 in the command line.
173 .PP
174 By default calls to methods and properties in the
175 System.Diagnostics.Debug class are not generated unless the DEBUG
176 symbol is defined (either through a "#define DEBUG") in your source
177 code, or by using the
178 .I "--define DEBUG"
179 in the command line.
180 .PP
181 Note that the effect of defining TRACE and DEBUG is a global setting,
182 even if they are only defined in a single file.
183 .PP
184 .SH DEBUGGING SUPPORT
185 When use the "--debug" or "-g" flag, MCS will create an assembler file
186 FILE-debug.s containing debugging information where FILE is the name of
187 the generated assembly. You need to run this file through the assembler
188 to get a object file FILE-debug.o.  See mono's "--dwarf-plus" argument
189 for details on how to use this file.
190 .SH NOTES
191 During compilation the MCS compiler defines the __MonoCS__ symbol,
192 this can be used by pre-processor instructions to compile Mono C#
193 compiler specific code.
194 .SH AUTHORS
195 The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap and
196 Martin Baulig at Ximian.
197 .PP
198 .SH LICENSE
199 The Mono Compiler Suite is released under the terms of the GNU GPL.
200 Please read the accompanying `COPYING' file for details.  Alternative
201 licenses are available from Ximian.
202 .PP
203 .SH SEE ALSO
204 mono(1), mint(1)
205 .PP
206 .SH BUGS
207 To report bugs in the compiler, you can use `bug-buddy', or you can
208 file bug reports in our bug tracking system:
209 http://bugzilla.ximian.com.
210 .SH MAILING LIST
211 The Mono Mailing List is available at: mono-list-request@ximian.com
212 .SH MORE INFORMATION
213 The Mono C# compiler is developed by Ximian, Inc
214 (http://www.ximian.com) (http://www.ximian.com) and is based on the
215 ECMA C# language standard available here:
216 http://www.ecma.ch/ecma1/STAND/ecma-334.htm
217
218