Output control

The options in this category control the type of output file the compiler produces, as well as the locations of the output. These are the basic options that determine the following aspects:
  • The compiler components that will be invoked
  • The preprocessing, compilation, and linking steps that will (or will not) be taken
  • 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.

-dM (-qshowmacros)

Emits macro definitions to 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.

-qmakedep, -MD (-qmakedep=gcc)

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

-qtimestamps

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

-shared (-qmkshrobj)

Creates a shared object from generated object files.

-S

Generates an assembler language file for each source file.

-X (-W)

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

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


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