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