3.3 Compilation-Driver Interface Syntax

The compilation-driver program (xc32-gcc) preprocesses, compiles, assembles, and links C and assembly-language modules and library archives. This driver orchestrates the build process so that you often don't need to know which individual programs preprocess, compile, assemble, and link. The driver calls the appropriate individual tools to complete the requested build process.

In practice, the assembler is usually invoked via the xc32-gcc driver, which determines from an input file's .S or .s extension that the file contain assembly code that should be assembled. The compilation driver sends a file with a *.S (upper case) extension through the CPP-style preprocessor before it passes the file to the assembler while the driver sends a file with a *.s (lower case) extension directly to the assembler.

The basic form of the compilation-driver command line is:
xc32-gcc [options] files
Note: Command-line options and file name extensions are case sensitive.
To pass an assembler option from the compilation driver to the assembler, use the -Wa option. The option argument should not contain white space. See the following example.
xc32-gcc -mprocessor=32MX360F512L -I"./include" ASMfile.S
-o"ASMfile.o" -DMYMACRO=1 -Wa,-ah="ASMfile.lst"

For additional information on the compilation driver, see the compiler user's guide relevant for your target device.

Note: To use the xc32-gcc compilation driver from MPLAB X IDE, be sure to select the XC32 Compiler Toolchain for your project.