Add data dir
[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 /resource:RESOURCE
98 Embeds to the given resource file.
99 .TP
100 .I /linkresource:RESOURCE 
101 Links to the given resource file.
102 .TP
103 .I \-recurse:PATTERN, --recurse PATTERN
104 Does recursive compilation using the specified pattern.  In Unix the
105 shell will perform globbing, so you migth want to use it like this:
106 .PP
107 .nf
108                 bash$ mcs -recurse:'*.cs' 
109 .fi
110 .TP
111 .I \-target:KIND, \-t:KIND
112 Used to specify the desired target.  The possible values are: exe,
113 winexe, library and module.  
114 .TP
115 .I \-\-timestamp
116 Another debugging flag.  Used to display the times at various points
117 in the compilation process.
118 .TP
119 .I \-unsafe, -unsafe+
120 Enables compilation of unsafe code.
121 .TP
122 .I \-warnaserror, \-warnaserror+
123 Treat warnings as errors.
124 .TP
125 .I \-warn:LEVEL
126 Sets the warning level.  0 is the lowest warning level, and 4 is the
127 highest.  The default is 2.
128 .TP
129 .I -r:ASSEMBLY, \-r ASSEMBLY
130 Reference the named assembly.  Use this to use classes from the named
131 assembly in your program.  The assembly will be loaded from either the
132 system directory where all the assemblies live, or from the path
133 explicitly given with the -L option.
134 .TP
135 .I \-v 
136 Debugging. Turns on verbose yacc parsing.
137 .TP
138 .I \-\-
139 Use this to stop option parsing, and allow option-looking parameters
140 to be passed on the command line.
141 .PP
142 .SH SPECIAL DEFINES
143 The 
144 .B TRACE
145 and
146 .B DEBUG
147 defines have a special meaning to the compiler.
148 .PP
149 By default calls to methods and properties in the
150 System.Diagnostics.Trace class are not generated unless the TRACE
151 symbol is defined (either through a "#define TRACE") in your source
152 code, or by using the
153 .I "--define TRACE"
154 in the command line.
155 .PP
156 By default calls to methods and properties in the
157 System.Diagnostics.Debug class are not generated unless the DEBUG
158 symbol is defined (either through a "#define DEBUG") in your source
159 code, or by using the
160 .I "--define DEBUG"
161 in the command line.
162 .PP
163 Note that the effect of defining TRACE and DEBUG is a global setting,
164 even if they are only defined in a single file.
165 .PP
166 .SH DEBUGGING SUPPORT
167 When use the "--debug" or "-g" flag, MCS will create an assembler file
168 FILE-debug.s containing debugging information where FILE is the name of
169 the generated assembly. You need to run this file through the assembler
170 to get a object file FILE-debug.o.  See mono's "--dwarf-plus" argument
171 for details on how to use this file.
172 .SH NOTES
173 During compilation the MCS compiler defines the __MonoCS__ symbol,
174 this can be used by pre-processor instructions to compile Mono C#
175 compiler specific code.
176 .SH AUTHORS
177 The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap and
178 Martin Baulig at Ximian.
179 .PP
180 .SH LICENSE
181 The Mono Compiler Suite is released under the terms of the GNU GPL.
182 Please read the accompanying `COPYING' file for details.  Alternative
183 licenses are available from Ximian.
184 .PP
185 .SH SEE ALSO
186 mono(1), mint(1)
187 .PP
188 .SH BUGS
189 To report bugs in the compiler, you can use `bug-buddy', or you can
190 file bug reports in our bug tracking system:
191 http://bugzilla.ximian.com.
192 .SH MAILING LIST
193 The Mono Mailing List is available at: mono-list-request@ximian.com
194 .SH MORE INFORMATION
195 The Mono C# compiler is developed by Ximian, Inc
196 (http://www.ximian.com) (http://www.ximian.com) and is based on the
197 ECMA C# language standard available here:
198 http://www.ecma.ch/ecma1/STAND/ecma-334.htm
199
200