5.7.6.4 Save-temps Option

The -save-temps option instructs the compiler to keep temporary files after compilation has finished. You might find the generated .i and .s temporary files in particular useful for troubleshooting, and they are often used by the Microchip Support team when you enter a support ticket.

The intermediate files will be placed in the current directory and have a name based on the corresponding source file. Thus, compiling foo.c with -save-temps would produce foo.i, foo.s and the foo.o object file.

The -save-temps=cwd option is equivalent to -save-temps.

The -save-temps=obj form of this option is similar to -save-temps, but if the -o option is specified, the temporary files are placed in the same directory as the output object file. If the -o option is not specified, the -save-temps=obj switch behaves like –save-temps.

The following example will create dir/xbar.i, dir/xbar.s, since the -o option was used.

 xc32-gcc -save-temps=obj -c bar.c -o dir/xbar.o