Output control

The options in this category control the type of file output the compiler produces, as well as the locations of the output. These are the basic options that determine the compiler components that will be invoked; the preprocessing, compilation, and linking steps that will (or will not) be taken; and the kind of output to be generated.
Table 1. Compiler output options
Option name Description
-c

Instructs the compiler to compile or assemble the source files only but do not link. With this option, the output is a .o file for each source file.

-C, -C!

When used in conjunction with the -E or -P options, preserves or removes comments in preprocessed output.

-E

Preprocesses the source files named in the compiler invocation, without compiling.

-o

Specifies a name for the output object, assembler, executable, or preprocessed file.

-P

Preprocesses the source files named in the compiler invocation, without compiling, and creates an output preprocessed file for each input file.

-S

Generates an assembler language file for each source file.

-X (-W)

-Xpreprocessor option or -Wp,preprocessor option passes the listed option directly to the preprocessor.

-qmakedep, -MD (-qmakedep=gcc)

Produces the dependency files that are used by the make tool for each source file.

-dM (-qshowmacros)

Emits macro definitions to preprocessed output.

-qtimestamps

Controls whether or not implicit time stamps are inserted into an object file.

-shared (-qmkshrobj)

Creates a shared object from generated object files.

The following options are supported by XL C/C++ for GCC compatibility. For details about these options, see the GNU Compiler Collection online documentation at http://gcc.gnu.org/onlinedocs/.
  • -###
  • -dCHARS
  • -M
  • -MD
  • -MF file
  • -MG
  • -MM
  • -MMD
  • -MP
  • -MQ target
  • -MT target
  • -Xpreprocessor option


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us