174 lines
5.6 KiB
HTML
174 lines
5.6 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>cc(1)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>cc(1)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
cc - C compiler
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>cc</STRONG> [<STRONG>-STOUfcimos</STRONG>] [<STRONG>-w[aos]</STRONG>] [<STRONG>-v[n]</STRONG>] [<STRONG>-D</STRONG><EM>name</EM>]* [<STRONG>-I</STRONG><EM>dir</EM>]* [<STRONG>-L</STRONG><EM>dir</EM>]* <EM>file</EM>+
|
|
[<STRONG>-l</STRONG><EM>name</EM>]*
|
|
|
|
|
|
</PRE>
|
|
<H2>OPTIONS</H2><PRE>
|
|
|
|
<STRONG>-D</STRONG> The flag <STRONG>-D</STRONG><EM>x</EM>[=<EM>y</EM>] defines a macro <EM>x</EM> with (optional) value <EM>y</EM>
|
|
|
|
<STRONG>-I</STRONG> <STRONG>-I</STRONG><EM>dir</EM> searches <EM>dir</EM> for include files
|
|
|
|
<STRONG>-L</STRONG> <STRONG>-L</STRONG><EM>dir</EM> searches <EM>dir</EM> for <STRONG>-l</STRONG><EM>name</EM> libraries
|
|
|
|
<STRONG>-O</STRONG> Optimize the code
|
|
|
|
<STRONG>-S</STRONG> Produce an assembly code file, then stop
|
|
|
|
<STRONG>-T</STRONG> The flag <STRONG>-T</STRONG><EM>dir</EM> tells <EM>cc</EM> and <EM>as</EM> to use <EM>dir</EM> for temporary files
|
|
|
|
<STRONG>-U</STRONG> Undefine a macro
|
|
|
|
<STRONG>-E</STRONG> Preprocess to standard output
|
|
|
|
<STRONG>-c</STRONG> Compile only. Do not link
|
|
|
|
<STRONG>-f</STRONG> Link with floating point emulation library
|
|
|
|
<STRONG>-i</STRONG> Use separate I & D space (64K + 64K) ( only)
|
|
|
|
<STRONG>-l</STRONG> The flag <STRONG>-l</STRONG><EM>name</EM> causes the library lib<EM>name</EM>.a to be linked
|
|
|
|
<STRONG>-m</STRONG> Remove unnecessary prototypes after preprocessing ( only)
|
|
|
|
<STRONG>-o</STRONG> Put output on file named by next arg
|
|
|
|
<STRONG>-s</STRONG> Strip the symbol-table from executable file
|
|
|
|
<STRONG>-v</STRONG> Verbose; print pass names
|
|
|
|
<STRONG>-vn</STRONG> Verbose; print pass names but do not run them
|
|
|
|
<STRONG>-w</STRONG> Suppress warning messages
|
|
|
|
<STRONG>-ws</STRONG> Suppress strict messages
|
|
|
|
<STRONG>-wa</STRONG> Suppress all warning and strict messages
|
|
|
|
|
|
<STRONG>-wo</STRONG> Suppress messages about old-style
|
|
|
|
<STRONG>-.o</STRONG> Do not link the default run-time start-off
|
|
|
|
|
|
</PRE>
|
|
<H2>EXAMPLES</H2><PRE>
|
|
|
|
<STRONG>cc</STRONG> <STRONG>-c</STRONG> <STRONG>file.c</STRONG> # Compile <EM>file</EM>.<EM>c</EM>
|
|
|
|
<STRONG>cc</STRONG> <STRONG>-DFOO</STRONG> <STRONG>file.c</STRONG> # Treat the symbol <EM>FOO</EM> as defined
|
|
|
|
<STRONG>cc</STRONG> <STRONG>-wo</STRONG> <STRONG>-o</STRONG> <STRONG>out</STRONG> <STRONG>file.c</STRONG>
|
|
# Compile old-style code; output to <EM>out</EM>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
|
|
This is the C compiler. It has eight passes, as follows:
|
|
|
|
<STRONG>Program</STRONG> <STRONG>Input</STRONG> <STRONG>Output</STRONG> <STRONG>Operation</STRONG> <STRONG>performed</STRONG>
|
|
lib/ncpp prog.c prog.i C preprocessor: #include, #define, #ifdef
|
|
lib/irrel prog.i prog.i Removal of unnecessary prototypes
|
|
lib/ncem prog.i prog.k Parsing and semantic analysis
|
|
lib/nopt prog.k prog.m Optimization of the intermediate code
|
|
lib/ncg prog.m prog.s Code generation
|
|
bin/as prog.s prog.o Assembly
|
|
lib/ld prog.o prog.out Linking
|
|
lib/cv prog.out a.out Conversion to MINIX a.out format
|
|
|
|
In the 68000 versions of MINIX , the preprocessor is not called since the
|
|
front-end contains the preprocessor. This increases compilation speed.
|
|
|
|
The main program, <EM>cc</EM> , forks appropriately to call the passes,
|
|
transmitting flags and arguments. The <STRONG>-v</STRONG> flag causes the passes to be
|
|
listed as they are called, and the <STRONG>-vn</STRONG> flag causes the passes to be
|
|
listed but not called.
|
|
|
|
The libraries should be made with <EM>aal</EM> (which is the same as <EM>ar</EM> on the
|
|
68000 versions), and consist of .o files. The internal order of files
|
|
inside the library is unimportant, but the order in which the libraries
|
|
are specified is.
|
|
|
|
When <STRONG>-T</STRONG> is used, the intermediate files end up in the directory
|
|
specified. Otherwise, <STRONG>/tmp</STRONG> is used. When available memory is very
|
|
limited (e.g., a 512K machine), it may be necessary to run <EM>chmem</EM> to
|
|
reduce the sizes of the compiler passes that do not fit, typically <EM>ncem</EM> .
|
|
|
|
On the other hand, if the compiler (or, in fact, almost any program)
|
|
begins acting strange, it is almost always due to its running out of
|
|
space, either stack space or scratch file space. The relevant pass can
|
|
be given more stack space using <EM>chmem</EM> . More space for scratch files can
|
|
be obtained by removing other files on the device.
|
|
If the compiler runs out of memory, it may be necessary to use the <STRONG>-m</STRONG>
|
|
flag. This causes <EM>irrel</EM> to be run, which removes unnecessary prototypes
|
|
and thus frees up extra table space within the compiler. Beware,
|
|
however, that running this pass may cause strictly conforming programs to
|
|
become non-conforming and vice versa, so you should only run this pass as
|
|
a last resort.
|
|
|
|
The compiler is derived from the ACK system (Tanenbaum et al.,
|
|
<EM>Communications</EM> <EM>of</EM> <EM>the</EM> <EM>ACM</EM>, Sept. 1983), not from the AT&T portable C
|
|
compiler. It has been shoehorned onto the PC with some loss of
|
|
performance.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/make.1.html">make(1)</A></STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|