Node:Built Target, Next:, Previous:Compiler Options, Up:Compiler Options



Built Target

The following options specify the target type produced by the compiler:

-E
Preprocess only. Compiler directives are executed. Comment lines are removed. COPY statements are expanded. The output goes to the standard-out.
-C
Translation only. COBOL source files are translated into C files. The output is saved in file *.c.
-S
Compile only. Translated C files are compiled by cc. The output is saved in file *.s.
-c
Compile and assemble. This is equivalent to cc -c. The output is saved in file *.o.
-m
Compile, assemble, and build a dynamic-linking module (i.e., a shared library). The output is saved in file *.so.

Without any options above, the compiler tries to build an executable.

When you build an executable, the compiler implicitly gives the option `-fmain', which includes a main function in the output file.

-fmain
Include the main function in the output.

This option takes effect at the translation stage. If you give this option with -C, you will see the main function at the end of the generated C file.