7.1.1 Drive Command-Line Format

The basic form of the compiler command line is:

xc16-gcc [options] files

where:

options: See Driver Option Descriptions for available options.

files: See Input File Types for details.

Note: Command-line options and file name extensions are case-sensitive.

It is assumed in this manual that the compiler applications are either in the console’s search path (see Environment Variables) or the full path is specified when executing any application.

It is conventional to supply options (identified by a leading dash “-”) before the file names, although this is not mandatory.

The files may be any mixture of C and assembler source files and precompiled intermediate files, such as relocatable object (.o) files. The order of the files is not important, except that it may affect the order in which code or data appears in memory.

For example, to compile, assemble and link the C source file hello.c, creating a relocatable object output, hello.elf.

xc16-gcc -mcpu=30f2010 -T p30f2010.gld -o hello.elf hello.c