| |||
| Home > Compiler Command-line Options > -o filename | |||
This option specifies the name of the output file. The full name of the output file produced depends on the combination of options used, as described in Table 5 and Table 6.
If you specify a -o option, the compiler
names the output file according to the conventions of Table 5.
Table 5. Compiling with the -o option
| Compiler option | Action | Usage notes |
|---|---|---|
-o- | writes output to the standard output stream | is -.-S is assumed
unless -E is specified. |
-o | produces an executable image with name | |
-c -o | produces an object file with name | |
-S -o | produces an assembly language file with name | |
-E -o | produces a file containing preprocessor output
with name |
This option overrides the --default_extension option.
If you do not specify a -o option, the compiler
names the output file according to the conventions of Table 6.
Table 6. Compiling without the -o option
| Compiler option | Action | Usage notes |
|---|---|---|
-c | produces an object file whose name defaults
to the name of the input file with the filename extension .o | |
-S | produces an output file whose name defaults
to the name of the input file with the filename extension .s | |
-E | writes output from the preprocessor to the standard output stream | |
| (No option) | produces an executable image with the default
name of __image.axf | none of -o, -c, -E or
-S is specified on the command line |