/usr/ccs/bin/cc [options] filesCompile one or more C source files (file.c), assembler source files (file.s), or preprocessed C source files (file.i). cc automatically invokes the loader ld (unless -c is supplied). In some cases, cc generates an object file having a .o suffix and a corresponding root name. By default, output is placed in a.out. cc accepts additional system-specific options.
Add /usr/ccs/bin to your PATH to use the C compiler and other C Compilation System tools. This command runs the ANSI C compiler; use /usr/bin/cc if you want to run the compiler for pre-ANSI C.
Solaris 7 does not come with a C compiler. You must purchase one separately from Sun, or download the GNU C Compiler (GCC) from http://www.sunfreeware.com.
Options for cc vary wildly across Unix systems. We have chosen here to document only those options that are commonly available. You will need to check your local documentation for complete information.
Usually, cc passes any unrecognized options to the loader, ld.
-cSuppress loading and keep any object files that were produced.
-Dname[=def]Supply a #define directive, defining name to be def or, if no def is given, the value 1.
-ERun only the macro preprocessor, sending results to standard output.
-gGenerate more symbol-table information needed for debuggers.
-IdirSearch for include files in directory dir (in addition to standard locations). Supply a -I for each new dir to be searched.
-lnameLink source file with library files libname.so or libname.a.
-LdirLike -I, but search dir for library archives.
-o fileSend object output to file instead of to a.out.
-OOptimize object code (produced from .c or .i files).
-pGenerate benchmark code to count the times each routine is called. File mon.out is created, so prof can be used later to produce an execution profile.
-PRun only the preprocessor and place the result in file.i.
-SCompile (and optimize, if -O is supplied), but don't assemble or load; assembler output is placed in file.s.
-UnameRemove definition of name, as if through an #undef directive.