Download CodeWarrior™ Development Tools Metrowerks
Transcript
U s in g th e Metro w erk s E n te rp ri se C C o mp i ler Specifying Preprocessing Options Changing preprocessed output You can specify any of the options in Table 3.5 to change the format and content of the preprocessed output. These options can be specified in addition to the -E option, or instead of the -E option. Table 3.5 Options to change preprocessed output Option Description -C Keeps all comments (preprocessor directives) in the preprocessing output. If you specify the -E option only, the preprocessed text is written to the output file with line control information only, and with all comments removed. -M [file] Instead of the normal preprocessing output, an output file is generated in MAKE format, containing a list showing the dependencies between the input source files. If no file is specified, the output is sent to the standard output stream, stdout. -MH [file] Instead of the normal preprocessing output, an output file is generated containing a list of all the #include files used in the source. This list includes all levels of #include files, together with any nested files. If no file is specified, the output is sent to the standard output stream, stdout. Defining and undefining preprocessor macros You can define one or more preprocessor macros, and you can remove the definition of a macro. You can specify the macro options in Table 3.6 more than once in the command line, to define and undefine different preprocessor macros. Table 3.6 Macro options Option Description -D macro [=value] Defines the named macro as a preprocessor macro, with the specified value. If value is omitted, the value 1 (one) is assumed. Once a preprocessor macro is defined with this option, it is passed by the shell to the preprocessor for all subsequent compilations until it is undefined with the -U option. The space between the -D option and the named macro is optional. -U macro Undefines the named macro by removing its previous definition. The macro will not be passed to the preprocessor unless it is redefined with the -D option. Any -U options in the command line are processed only after all -D options have been processed. It is not necessary to enter a space between the -U option and the named macro. ECM–36 Metrowerks Enterprise C Compiler User’s Manual