Compilation

cpik -c [-v] [-Dmacro[=value]][-o output_file] [-I path] 
                                  [-p device] [-d<value>] input_file

-v : prints version number, then exits immediatly.

-o output_file : Specifies the output (source library) file name. By default, this name is generated from the source file name by appending .slb to the extensionless input file name.

-Dmacro[=value] : specifies a macro definition that is passed to the cpp preprocessor. Notice that there is no white space after «-D»

-I path : specifies the path to include (.h) files. This option follows the traditionnal behaviour of Unix C compilers. You can specify any number of include path, and they will be searched in the order of the -I options. As usual, use "-I ." to specify the current directory. If your header file is located in the default system directory (ie: /usr/share/cpik/<version>/include/), do not forget to use #include <xxx> instead of #include "xxx" in your source code. Notice that «-I A,B,C» is an allowed shortcut for «-I A -I B -I C».

-p device : specifies the target pic device name. device must be a valid pic 18 name like p18xxxx. The exact name is not checked, excepted the p18 prefix. And invalid device will cause the final assembly to fail. The target device is p18f1220 by default.

-d<value> : debug option, used for the development/debugging of the compiler itself. The value is an integer which specify what debug information should be printed. Any number of -d options can be used.

value meaning
-d1 print unoptimized intermediate code as comment in .slb file
-d2 print peep hole optimized intermediate code as comment in .slb file
-d4 print symbol tables with entities names and types
-d8 print internal expression trees before optimisations, without type annotation
-d16 print internal expression trees before optimisations, with type annotations
-d32 print internal expression trees after optimisations, without type annotation
-d64 print internal expression trees after optimisations, with type annotations

The usage of the -d option is never useful for normal operations with cpik. Produced outputs are hard to interpret for non developers.

input_file : specifies the source file name, with .c extension.

This command cannot be used to compile more than to one source file in a single invocation.

AG 2013-04-10