| |||
| Home > Using the ARM Compiler > armcc command syntax > Setting preprocessor options | |||
These options are used for controlling aspects of the preprocessor. (See Pragmas for descriptions of other preprocessor options that can be set by pragmas.)
-EExecutes only the preprocessor phase of the compiler. By default, output from the preprocessor is sent to the standard output stream and can be redirected to a file using standard MS-DOS notation, for example:
armcc -E source.c > raw.c
You can also use the -o option to specify
a file for the preprocessed output (see Specifying output format). By default, comments are stripped from
the output. The preprocessor accepts source files with any extension
(for example, .o, .s, and .txt).
See also the -C option.
-CRetains
comments in preprocessor output when used in conjunction with -E,
and must be specified after -E. The -C option
does not request preprocessing output when used alone.
This option differs from the -c (lowercase)
option that suppresses the link step. See Specifying output format for a description of the -c option.
-MExecutes
only the preprocessor phase of the compiler (see the -E option). This
option produces a list of make file dependency lines suitable for
use by a make utility. By default, output is on the standard output
stream. You can redirect output to a file by using standard MS-DOS
notation, for example:
armcc -M source.c > Makefile
If you specify multiple source files, a single dependency file is created.
If you specify the -o option
(see Specifying output format), the
dependency lines generated on standard output refer to filenamefilename.o,
and not to source.o. However, no object file
is produced with the combination of -M -o .filename
Use the --md option to generate dependency
lines and object files for each source file.
-Dname [
(parm-list) ] [ =def ]Defines a macro name as .
If def= is omitted,
the compiler defines def to
expand as the value 1. You can define function-style macros by appending
a macro parameter list to name.
The compiler defines macro names based on the command-line options.
For a list, see Predefined macros.name
-UnameRemoves any initial definition of the macro .
This has the same effect as the text name#undef at
the head of the source file. You can repeat this option.name
Where you specify macro options, the compiler defines and undefines macros in the following order:
compiler predefined macros (see Predefined macros).
macros defined explicitly, using -D.name
macros explicitly undefined, using -U.name