121 lines
4.3 KiB
Groff
121 lines
4.3 KiB
Groff
.TH CC 1
|
|
.SH NAME
|
|
cc \- C compiler
|
|
.SH SYNOPSIS
|
|
\fBcc\fR [\fB\-STOUfcimos\fR]\fR [\fB\-w[aos]\fR] [\fB\-v[n]\fR] [\fB\-D\fIname\fR]* [\fB\-I\fIdir\fR]* [\fB\-L\fIdir\fR]* \fIfile\fR+ [\fB\-l\fIname\fR]*\fR
|
|
.br
|
|
.de FL
|
|
.TP
|
|
\\fB\\$1\\fR
|
|
\\$2
|
|
..
|
|
.de EX
|
|
.TP 20
|
|
\\fB\\$1\\fR
|
|
# \\$2
|
|
..
|
|
.SH OPTIONS
|
|
.FL "\-D" "The flag \fB\-D\fIx[=y]\fR defines a macro \fIx\fR with (optional) value \fIy\fR"
|
|
.FL "\-I" "\fB\-I\fIdir\fR searches \fIdir\fR for include files"
|
|
.FL "\-L" "\fB\-L\fIdir\fR searches \fIdir\fR for \fB\-l\fIname\fR libraries"
|
|
.FL "\-O" "Optimize the code"
|
|
.FL "\-S" "Produce an assembly code file, then stop"
|
|
.FL "\-T" "The flag \fB\-T\fIdir\fR tells \fIcc\fR and \fIas\fR to use \fIdir\fR for temporary files"
|
|
.FL "\-U" "Undefine a macro"
|
|
.FL "\-E" "Preprocess to standard output"
|
|
.FL "\-c" "Compile only. Do not link"
|
|
.FL "\-f" "Link with floating point emulation library"
|
|
.FL "\-i" "Use separate I & D space (64K + 64K) (\*(Mp only)"
|
|
.FL "\-l" "The flag \fB\-l\fIname\fR causes the library lib\fIname\fR.a to be linked"
|
|
.FL "\-m" "Remove unnecessary prototypes after preprocessing (\*(Mp only)"
|
|
.FL "\-o" "Put output on file named by next arg"
|
|
.FL "\-s" "Strip the symbol-table from executable file"
|
|
.FL "\-v" "Verbose; print pass names"
|
|
.FL "\-vn" "\fRVerbose; print pass names but do not run them"
|
|
.FL "\-w" "\fRSuppress warning messages"
|
|
.FL "\-ws" "\fRSuppress strict messages"
|
|
.FL "\-wa" "\fRSuppress all warning and strict messages"
|
|
.FL "\-wo" "\fRSuppress messages about old-style"
|
|
.FL "\-.o" "Do not link the default run-time start-off"
|
|
.SH EXAMPLES
|
|
.EX "cc \-c file.c" "Compile \fIfile.c\fR"
|
|
.EX "cc \-DFOO file.c" "Treat the symbol \fIFOO\fR as defined"
|
|
.EX "cc \-wo \-o out file.c" "Compile old-style code; output to \fIout\fR"
|
|
.SH DESCRIPTION
|
|
.\" .if t .ta 0.9i 1.25i 2.75i 3.25i 3.75i
|
|
.\" .if n .ta 10 15 39
|
|
.PP
|
|
This is the C compiler.
|
|
It has eight passes, as follows:
|
|
.PP
|
|
.if t .ta 1.4i 2.1i 2.8i
|
|
.if n .ta 13 21 30
|
|
\fBProgram Input Output Operation performed\fR
|
|
.br
|
|
lib/ncpp prog.c prog.i C preprocessor: #include, #define, #ifdef
|
|
.br
|
|
lib/irrel prog.i prog.i Removal of unnecessary prototypes
|
|
.br
|
|
lib/ncem prog.i prog.k Parsing and semantic analysis
|
|
.br
|
|
lib/nopt prog.k prog.m Optimization of the intermediate code
|
|
.br
|
|
lib/ncg prog.m prog.s Code generation
|
|
.br
|
|
bin/as prog.s prog.o Assembly
|
|
.br
|
|
lib/ld prog.o prog.out Linking
|
|
.br
|
|
lib/cv prog.out a.out Conversion to \s-1MINIX\s0 a.out format
|
|
.PP
|
|
In the 68000 versions of \s-1MINIX\s0 , the preprocessor is not called since the
|
|
front-end contains the preprocessor. This increases compilation speed.
|
|
.PP
|
|
The main program,
|
|
.I cc ,
|
|
forks appropriately to call the passes, transmitting flags and arguments.
|
|
The \fB\-v\fR flag causes the passes to be listed as they are called, and
|
|
the \fB\-vn\fR flag causes the passes to be listed but not called.
|
|
.PP
|
|
The libraries should be made with \fIaal\fR (which is the same as \fIar\fR 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.
|
|
.PP
|
|
.PP
|
|
When \fB\-T\fR is used, the intermediate files end up in the directory
|
|
specified. Otherwise,
|
|
.B /tmp
|
|
is used.
|
|
When available memory is very limited (e.g., a 512K machine), it may be
|
|
necessary to run
|
|
.I chmem
|
|
to reduce the sizes of the compiler passes that do not fit, typically
|
|
.I ncem .
|
|
.PP
|
|
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
|
|
.I chmem .
|
|
More space for scratch files can be obtained
|
|
by removing other files on the device.
|
|
.PP
|
|
If the compiler runs out of memory, it may be necessary to use the
|
|
\fB\-m\fR flag. This causes
|
|
.I irrel
|
|
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.
|
|
.PP
|
|
The compiler is derived from the ACK system (Tanenbaum et
|
|
al., \fICommunications of the ACM\fR, Sept. 1983),
|
|
not from the AT&T portable C compiler.
|
|
It has been shoehorned onto the PC with some loss of performance.
|
|
.SH "SEE ALSO"
|
|
.BR make (1).
|