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