Using and Porting GNU CC
Compilation can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order. The first three stages apply to an individual source file, and end by producing an object file; linking combines all the object files (those newly compiled, and those specified as input) into an executable file.
For any given input file, the file name suffix determines what kind of compilation is done:
libobjc.a' to make an Objective-C program work.
.cxx', the last two letters must both be literally `
x'. Likewise, `
.C' refers to a literal capital C.
You can specify the input language explicitly with the `
-x' option. Possible values for language are:
c objective-c c++ c-header cpp-output c++-cpp-output assembler assembler-with-cpp
-x' has not been used at all).
If you only want some of the stages of compilation, you can use
-x' (or filename suffixes) to tell
gcc where to start, and
one of the options `
-S', or `
-E' to say where
gcc is to stop. Note that some combinations (for example,
-x cpp-output -E' instruct
gcc to do nothing at all.
By default, the object file name for a source file is made by replacing
the suffix `
.s', etc., with `
Unrecognized input files, not requiring compilation or assembly, are ignored.
By default, the assembler file name for a source file is made by
replacing the suffix `
.i', etc., with `
Input files that don't require compilation are ignored.
Input files which don't require preprocessing are ignored.
Since only one output file can be specified, it does not make sense to
-o' when compiling more than one input file, unless you are
producing an executable file as output.
-o' is not specified, the default is to put an executable file
a.out', the object file for `
source.o', its assembler file in `
all preprocessed C source on standard output.