2002-07-25 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 C# source files must end with a ".cs" extension.  Compilation of C#
15 source code requires all the files that make up a library, module or
16 executable to be provided on the command line.  There is no support
17 for partial compilation.  To achieve the benefits of partial
18 compilation, you should compile programs into their own assemblies,
19 and later reference them with the "-r" flag.
20 .PP
21 The Mono C# compiler generates images (.exe files) that contain CIL
22 byte code that can be executed by any system that implements a Common
23 Language Infrastructure virtual machine such as the Microsoft .NET
24 runtime engine on Windows or the Mono runtime engine on Unix systems.
25 Executables are not bound to a specific CPU or operating system.
26 .PP
27 .SH OPTIONS
28 .TP
29 .I \-\-about
30 Displays information about the Mono C# compiler
31 .TP
32 .I \-\-checked
33 Sets the default compilation mode to `checked'.  This makes all
34 the math operations checked (the default is unchecked).
35 .TP
36 .I \-\-define SYMBOL
37 Defines a symbol named SYMBOL.  This can be tested in the source code
38 by the pre-processor.
39 .TP
40 .I \-\-debug or \-g
41 Generate debugging information.  
42 .TP
43 .I \-\-fatal 
44 This is used for debugging the compiler.  This makes the error emission
45 generate an exception that can be caught by a debugger.
46 .TP
47 .I \-\-stacktrace
48 Generates a stack trace at the time the error is reported, useful for
49 debugging the compiler.
50 .TP
51 .I \-L PATH
52 Directs the compiler to look for libraries in the specified path.
53 Multiple paths can be provided.
54 .TP
55 .I \-\-nostdlib
56 Use this flag if you want to compile the core library.  This makes the
57 compiler load its internal types from the assembly being compiled.
58 .TP
59 .I \-\-noconfig
60 Disables the default compiler configuration to be loaded.  The
61 compiler by default has references to the system assemblies. 
62 .TP
63 .I \-\-nowarn XXX
64 Makes the compiler ignore warning XXX.
65 .TP
66 .I \-o FNAME
67 Names the output file to be generated.
68 .TP
69 .I \-\-optimize
70 Turns on optimizations in the compiler.  
71 .TP
72 .I \-\-parse
73 Used for benchmarking.  The compiler will only parse its input files.
74 .TP
75 .I \-\-probe X L
76 Probes for the code to generate an error named `X' in line `L'.  This
77 is only used by the test suite.
78 .TP 
79 .I /linkres:RESOURCE
80 Links to the given resources
81 .TP
82 .I \-\-recurse PATTERN
83 Does recursive compilation using the specified pattern.  In Unix the
84 shell will perform globbing, so you migth want to use it like this:
85 .PP
86 .nf
87                 bash$ mcs --recurse '*.cs' 
88 .fi
89 .TP
90 .I \-\-linkres FILE
91 Links FILE as a resource of the resulting assembly.
92 .TP
93 .I \-\-target KIND
94 Used to specify the desired target.  The possible values are: exe,
95 winexe, library and module.  
96 .TP
97 .I \-\-timestamp
98 Another debugging flag.  Used to display the times at various points
99 in the compilation process.
100 .TP
101 .I \-\-unsafe
102 Enables compilation of unsafe code.
103 .TP
104 .I \-\-werror
105 Treat warnings as errors.
106 .TP
107 .I \-\-wlevel LEVEL
108 Sets the warning level.  0 is the lowest warning level, and 4 is the
109 highest.  The default is 2.
110 .TP
111 .I \-r ASSEMBLY
112 Reference the named assembly.  Use this to use classes from the named
113 assembly in your program.  The assembly will be loaded from either the
114 system directory where all the assemblies live, or from the path
115 explicitly given with the -L option.
116 .TP
117 .I \-v 
118 Debugging. Turns on verbose yacc parsing.
119 .TP
120 .I \-\-
121 Use this to stop option parsing, and allow option-looking parameters
122 to be passed on the command line.
123 .PP
124 .SH SPECIAL DEFINES
125 The 
126 .B TRACE
127 and
128 .B DEBUG
129 defines have a special meaning to the compiler.
130 .PP
131 By default calls to methods and properties in the
132 System.Diagnostics.Trace class are not generated unless the TRACE
133 symbol is defined (either through a "#define TRACE") in your source
134 code, or by using the
135 .I "--define TRACE"
136 in the command line.
137 .PP
138 By default calls to methods and properties in the
139 System.Diagnostics.Debug class are not generated unless the DEBUG
140 symbol is defined (either through a "#define DEBUG") in your source
141 code, or by using the
142 .I "--define DEBUG"
143 in the command line.
144 .PP
145 Note that the effect of defining TRACE and DEBUG is a global setting,
146 even if they are only defined in a single file.
147 .PP
148 .SH DEBUGGING SUPPORT
149 When use the "--debug" or "-g" flag, MCS will create an assembler file
150 FILE-debug.s containing debugging information where FILE is the name of
151 the generated assembly. You need to run this file through the assembler
152 to get a object file FILE-debug.o.  See mono's "--dwarf-plus" argument
153 for details on how to use this file.
154 .SH NOTES
155 During compilation the MCS compiler defines the __MonoCS__ symbol,
156 this can be used by pre-processor instructions to compile Mono C#
157 compiler specific code.
158 .SH AUTHORS
159 The Mono C# Compiler was written by Miguel de Icaza and Ravi Pratap at
160 Ximian. 
161 .PP
162 .SH LICENSE
163 The Mono Compiler Suite is released under the terms of the GNU GPL.
164 Please read the accompanying `COPYING' file for details.  Alternative
165 licenses are available from Ximian.
166 .PP
167 .SH SEE ALSO
168 mono(1), mint(1)
169 .PP
170 .SH BUGS
171 To report bugs in the compiler, you can use `bug-buddy', or you can
172 file bug reports in our bug tracking system:
173 http://bugzilla.ximian.com.
174 .SH MAILING LIST
175 The Mono Mailing List is available at: mono-list-request@ximian.com
176 .SH MORE INFORMATION
177 The Mono C# compiler is developed by Ximian, Inc
178 (http://www.ximian.com) (http://www.ximian.com) and is based on the
179 ECMA C# language standard available here:
180 http://www.ecma.ch/ecma1/STAND/ecma-334.htm
181
182