BSD 3 development
[unix-history] / usr / man / man1 / cc.1
CommitLineData
ee16d671
BJ
1.TH CC 1 "VAX/11"
2.SH NAME
3cc \- C compiler
4.SH SYNOPSIS
5.B cc
6[ option ] ... file ...
7.SH DESCRIPTION
8.I Cc
9is the UNIX C compiler.
10It accepts several types of arguments:
11.PP
12Arguments whose names end with `.c' are taken to be
13C source programs; they are compiled, and
14each object program is left on the file
15whose name is that of the source with `.o' substituted
16for `.c'.
17The `.o' file is normally deleted, however, if a single
18C program is compiled and loaded all at one go.
19.PP
20In the same way,
21arguments whose names end with `.s' are taken to be assembly source programs
22and are assembled, producing a `.o' file.
23.PP
24The following options are interpreted by
25.IR cc .
26See
27.IR ld (1)
28for load-time options.
29.TP 8
30.B \-c
31Suppress the loading phase of the compilation, and force
32an object file to be produced even if only one program is compiled.
33.TP
34.B \-g
35Have the compiler produce additional symbol table information
36for
37.IR sdb (1).
38Also pass the
39.B \-lg
40flag to
41.IR ld (1).
42.TP
43.B \-w
44Suppress warning diagnostics.
45.TP
46.B \-z
47Create load-on-demand format output (an
48.IR ld (1)
49flag);
50this is important to specify when loading certain very large programs.
51See
52.IR ld (1).
53.TP
54.B \-p
55Arrange for the compiler to produce code
56which counts the number of times each routine is called;
57also, if loading takes place, replace the standard startup
58routine by one which automatically calls
59.IR monitor (3)
60at the start and arranges to write out a
61.I mon.out
62file at normal termination of execution of the object program.
63An execution profile can then be generated by
64use of
65.IR prof (1).
66.TP
67.SM
68.B \-O
69Invoke an
70object-code improver.
71.TP
72.SM
73.B \-S
74Compile the named C programs, and leave the
75assembler-language output on corresponding files suffixed `.s'.
76.TP
77.SM
78.B \-E
79Run only the macro preprocessor
80on the named C programs, and send the result to the
81standard output.
82.TP
83.BI \-o " output"
84Name the final output file
85.IR output .
86If this option is used the file `a.out' will be left undisturbed.
87.TP
88.BI \-D name=def
89.br
90.ns
91.TP
92.SM
93.BI \-D \*Sname
94Define the
95.I name
96to the preprocessor,
97as if by
98`#define'.
99If no definition is given, the name is defined as "1".
100.TP
101.SM
102.BI \-U \*Sname
103Remove any initial definition of
104.IR name .
105.TP
106.SM
107.BI \-I \*Sdir
108`#include' files
109whose names do not begin with `/' are always
110sought first in the directory
111of the
112.I file
113argument,
114then in directories named in
115.B \-I
116options,
117then in directories on a standard list.
118.TP
119.SM
120.BI \-B \*Sstring
121Find substitute compiler passes in the files named
122.I string
123with the suffixes cpp, ccom and c2.
124If
125.I string
126is empty, use a standard backup version.
127.TP
128.BR \-t [ p012 ]
129Find only the designated compiler passes in the
130files whose names are constructed by a
131.B \-B
132option.
133In the absence of a
134.B \-B
135option, the
136.I string
137is taken to be `/usr/c/'.
138.PP
139Other arguments
140are taken
141to be either loader option arguments, or C-compatible
142object programs, typically produced by an earlier
143.I cc
144run,
145or perhaps libraries of C-compatible routines.
146These programs, together with the results of any
147compilations specified, are loaded (in the order
148given) to produce an executable program with name
149.B a.out.
150.SH FILES
151.ta \w'/usr/c/occom 'u
152file.c input file
153.br
154file.o object file
155.br
156a.out loaded output
157.br
158/tmp/ctm? temporary
159.br
160/lib/cpp preprocessor
161.br
162/lib/ccom compiler
163.br
164/usr/c/occom backup compiler
165.br
166/usr/c/ocpp backup preprocessor
167.br
168/lib/c2 optional optimizer
169.br
170/lib/crt0.o runtime startoff
171.br
172/lib/mcrt0.o startoff for profiling
173.br
174/lib/lib[ac].a standard libraries, see (3)
175.br
176/usr/include standard directory for `#include' files
177.SH "SEE ALSO"
178B. W. Kernighan and D. M. Ritchie,
179.I The C Programming Language,
180Prentice-Hall,
1811978
182.br
183B. W. Kernighan,
184.I
185Programming in C\(ema tutorial
186.br
187D. M. Ritchie,
188.I
189C Reference Manual
190.br
191monitor(3), prof(1), adb(1), ld(1), sdb(1)
192.SH DIAGNOSTICS
193The diagnostics produced by C itself are intended to be
194self-explanatory.
195Occasional messages may be produced by the assembler
196or loader.