cpik -c [-v] [-k] [-Dmacro[=value]][-o output_file] [-I path] [-p device] [-d<value>] input_file
-v
: prints the version number, then exits immediately, regardless the other options.
-k
:
This option asks the compiler to keep the output file
generated by the preprocessor (.c.c file), and the object file (.slb file), even when the compilation fails. The default behavior
of the compiler is to remove these files. This option is for debugging purpose only and do not need to be used in standard condition.
Note that the object file generated by cpik is likely to be corrupted in case of compilation error.
-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 extension-less 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 traditional behavior 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 optimizations, without type annotation |
-d16 | print internal expression trees before optimizations, with type annotations |
-d32 | print internal expression trees after optimizations, without type annotation |
-d64 | print internal expression trees after optimizations, with type annotations |
Notice that the -d option is never useful for normal operations with cpik. This option generates outputs that 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.
Alain Gibaud 2015-07-09