BBS水木清华站∶精华区
PREPROCESSOR OPTIONS
These options control the C preprocessor, which is run on
each C source file before actual compilation.
If you use the `-E' option, GCC does nothing except pre-
processing. Some of these options make sense only togeth-
er with `-E' because they cause the preprocessor output to
be unsuitable for actual compilation.
-include file
Process file as input before processing the regular
input file. In effect, the contents of file are
compiled first. Any `-D' and `-U' options on the
command line are always processed before `-include
file', regardless of the order in which they are
written. All the `-include' and `-imacros' options
are processed in the order in which they are writ-
ten.
-imacros file
Process file as input, discarding the resulting
output, before processing the regular input file.
Because the output generated from file is discard-
ed, the only effect of `-imacros file' is to make
the macros defined in file available for use in the
main input. The preprocessor evaluates any `-D'
and `-U' options on the command line before pro-
cessing `-imacrosfile', regardless of the order in
which they are written. All the `-include' and
`-imacros' options are processed in the order in
which they are written.
-idirafter dir
Add the directory dir to the second include path.
The directories on the second include path are
searched when a header file is not found in any of
the directories in the main include path (the one
that `-I' adds to).
-iprefix prefix
Specify prefix as the prefix for subsequent
`-iwithprefix' options.
-iwithprefix dir
Add a directory to the second include path. The
directory's name is made by concatenating prefix
and dir, where prefix was specified previously with
`-iprefix'.
-nostdinc
Do not search the standard system directories for
header files. Only the directories you have speci-
fied with `-I' options (and the current directory,
if appropriate) are searched.
By using both `-nostdinc' and `-I-', you can limit
the include-file search file to only those directo-
ries you specify explicitly.
-nostdinc++
Do not search for header files in the C++-specific
standard directories, but do still search the other
standard directories. (This option is used when
building `libg++'.)
-undef Do not predefine any nonstandard macros. (Includ-
ing architecture flags).
-E Run only the C preprocessor. Preprocess all the C
source files specified and output the results to
standard output or to the specified output file.
-C Tell the preprocessor not to discard comments.
Used with the `-E' option.
-P Tell the preprocessor not to generate `#line' com-
mands. Used with the `-E' option.
-M [ -MG ]
Tell the preprocessor to output a rule suitable for
make describing the dependencies of each object
file. For each source file, the preprocessor out-
puts one make-rule whose target is the object file
name for that source file and whose dependencies
are all the files `#include'd in it. This rule may
be a single line or may be continued with `\'-new-
line if it is long. The list of rules is printed
on standard output instead of the preprocessed C
program.
`-M' implies `-E'.
`-MG' says to treat missing header files as gener-
ated files and assume they live in the same direc-
tory as the source file. It must be specified in
addition to `-M'.
-MM [ -MG ]
Like `-M' but the output mentions only the user
header files included with `#include file"'. Sys-
tem header files included with `#include <file>'
are omitted.
-MD Like `-M' but the dependency information is written
to files with names made by replacing `.o' with
`.d' at the end of the output file names. This is
in addition to compiling the file as
specified--`-MD' does not inhibit ordinary compila-
tion the way `-M' does.
The Mach utility `md' can be used to merge the `.d'
files into a single dependency file suitable for
using with the `make' command.
-MMD Like `-MD' except mention only user header files,
not system header files.
-H Print the name of each header file used, in addi-
tion to other normal activities.
-Aquestion(answer)
Assert the answer answer for question, in case it
is tested with a preprocessor conditional such as
`#if #question(answer)'. `-A-' disables the stan-
dard assertions that normally describe the target
machine.
-Aquestion
(answer) Assert the answer answer for question, in
case it is tested with a preprocessor conditional
such as `#if #question(answer)'. `-A-' disables
the standard assertions that normally describe the
target machine.
-Dmacro
Define macro macro with the string `1' as its defi-
nition.
-Dmacro=defn
Define macro macro as defn. All instances of
`-D' on the command line are processed before any
`-U' options.
-Umacro
Undefine macro macro. `-U' options are evaluated
after all `-D' options, but before any `-include'
and `-imacros' options.
-dM Tell the preprocessor to output only a list of the
macro definitions that are in effect at the end of
preprocessing. Used with the `-E' option.
-dD Tell the preprocessor to pass all macro definitions
into the output, in their proper sequence in the
rest of the output.
-dN Like `-dD' except that the macro arguments and con-
tents are omitted. Only `#define name' is included
in the output.
BBS水木清华站∶精华区