cc and c89 compiler options

Both cc(1) and c89(1) recognize the most common compiler options. These are listed and described in the following table:

Compiler option Description
-c Compile but do not link/edit, and do not remove object files.
-D name[=value] Define name as if #define had been used. If value is not given, name is defined as 1.
-E Expand all C preprocessor directives, and copy the C source to standard output.
-g Include symbol information in the object or executable file.
-I directory Search directory for include files before searching the usual places (normally /usr/include).
-L directory Search directory for libraries before searching the usual places (normally /usr/lib).
-M Produce a linker map file. This option only has an effect if the linker is actually invoked.
-N [nostdlib|nostdinc|nostdc] Disables standard C features. This option can be given multiple times. The nostdlib option prevents the inclusion of standard library files. The nostdinc option prevents the inclusion of standard header files. The nostdc option turns on the Microsoft compiler extensions, and undefines the __STDC__ macro. The behavior of -N nostdc is the default for cc, but not for c89.
-O Optimize the generated code.
-o outfile Name the output executable file outfile. This option cannot be used with -c.
-P Preprocess the code and place in a file with an .i extension.
-S Create an assembler listing. The format and the file name depend upon the underlying compiler.
-s Strip all nonessential information from the object file or executable.
-U name "Undefine" name as if the #undef keyword has been given.
-X CLopt Pass the option string CLopt directly to the Cl.exe utility.
-Y Linkopt Pass the option string Linkopt directly to the Link.exe utility.