Commit | Line | Data |
---|---|---|
708f4980 C |
1 | Coccinelle |
2 | ||
3 | ||
34e49164 C |
4 | Coccinelle allows programmers to easily write some complex |
5 | style-preserving source-to-source transformations on C source code, | |
6 | like for instance to perform some refactorings. | |
7 | ||
8 | To install Coccinelle from its source, see the instructions in install.txt. | |
34e49164 C |
9 | Once you have installed Coccinelle (either from the source or from one |
10 | of the binary form available on the Coccinelle website), You may have | |
11 | to setup a few environment variables so that the Coccinelle program | |
708f4980 | 12 | knows where to find its configuration files. |
34e49164 C |
13 | For bash do: |
14 | ||
708f4980 | 15 | $ source env.sh |
34e49164 C |
16 | |
17 | For tcsh do: | |
18 | ||
708f4980 | 19 | $ source env.csh |
34e49164 C |
20 | |
21 | ||
22 | ||
23 | You can then test coccinelle with: | |
24 | ||
708f4980 | 25 | $ spatch -sp_file demos/simple.cocci demos/simple.c |
34e49164 C |
26 | |
27 | If you downloaded the bytecode version of spatch you may first | |
28 | have to install OCaml (which contains the 'ocamlrun' bytecode interpreter, | |
29 | the equivalent of 'java', the Java virtual machine, but for OCaml) and then do: | |
30 | ||
708f4980 C |
31 | $ ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c |
32 | ||
33 | ||
34 | ||
35 | For more information on Coccinelle, type 'make docs' and have a look at the | |
36 | files in the docs/ directory. You may need to install the texlive-fonts-extra | |
37 | packages from your distribution to compile some of the LaTeX documentation | |
38 | files. | |
39 |