Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual

Product codes
SW006021-1
Page of 518
XC8 Command-line Driver
 2012 Microchip Technology Inc.
DS52053B-page 109
4.8.44
--OUTPUT= type: Specify Output File Type
This option allows the type of the output file(s) to be specified. If no --OUTPUT option 
is specified, the output file’s name will be the same as the project name (see 
Section 4.3 “The Compilation Sequence”).
The available output file format are shown in Table 4-14. More than one output format 
may be specified by supplying a comma-separated list of tags. Not all formats are 
supported by Microchip development tools.
Those output file types which specify library formats stop the compilation process 
before the final stages of compilation are executed. Hence specifying an output file for-
mat list containing, for example: lib or all will prevent the other formats from being 
created.
So, for example:
xc8
 --CHIP=16F877AA --OUTPUT=lpp lcd_init.c lcd_data.c lcd_msgs.c
will compile the three names files into an LPP (p-code) library.
4.8.45
--PASS1: Compile to P-code
The --PASS1 option is used to generate p-code intermediate files (.p1 file) from the 
parser, then stop compilation. Such files need to be generated if creating p-code library 
files, however the compiler is able to generate library files in one step, if required. See 
Section 4.8.44 “--OUTPUT= type: Specify Output File Type” for specifying a library 
output file type.)
4.8.46
--PRE: Produce Preprocessed Source Code
The --PRE option is used to generate preprocessed C source files (also called mod-
ules or translation units) with an extension .pre. This may be useful to ensure that pre-
processor macros have expanded to what you think they should. Use of this option can 
also create C source files which do not require any separate header files. If the .pre 
files are renamed to .c files that can be passed to the compiler for subsequent pro-
cessing. This is useful when sending files to a colleague or to obtain technical support 
without having to send all the header files, which may reside in many directories.
If you wish to see the preprocessed source for the printf() family of functions, do 
not use this option. The source for this function is customized by the compiler, but only 
after the code generator has scanned the project for printf() usage. Thus, as the 
–-PRE
 option stops compilation after the preprocessor stage, the code generator will 
not execute and no printf() code will be processed. If this option is omitted, the 
preprocessed source for printf() will be automatically retained in the file 
doprnt.pre
.
TABLE 4-14:
OUTPUT FILE FORMATS
Type tag
 File format
lib
Object library file
lpp
P-code library file
intel
Intel HEX (default)
tek
Tektronic
aahex
American Automation symbolic HEX file
mot
Motorola S19 HEX file
bin
Binary file
mcof
Microchip COFF (default)