Specifying Compilation Output Overview

When compiling and linking a set of source files, you can use the -o or -S option to give the resulting file a name other than that of the first source or object file on the command line.

-c

Compile to object only (.o), do not link.

-S[file]

Produce assembly file or directory for multiple assembly files; for example, -Smyprog, -Smydir\.

-ofile

Produce object file or directory for multiple object files specified in file.

-ofile

Produce executable file or directory for multiple executable files specified in file.

If you are processing a single file, you can use the -ofile option to specify an alternate name for an object file (.o), an assembly file (.s) or an executable file. You can also use these options to override the default filename extensions: .o and .s.

See Compilation Output options summary.