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 | 20 | |
978fd7e5 C |
21 | You can then test coccinelle with: |
22 | ||
23 | $ spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c | |
34e49164 C |
24 | |
25 | ||
34e49164 | 26 | |
34e49164 C |
27 | |
28 | If you downloaded the bytecode version of spatch you may first | |
29 | have to install OCaml (which contains the 'ocamlrun' bytecode interpreter, | |
30 | the equivalent of 'java', the Java virtual machine, but for OCaml) and then do: | |
31 | ||
978fd7e5 | 32 | $ ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c |
708f4980 C |
33 | |
34 | ||
35 | ||
36 | For more information on Coccinelle, type 'make docs' and have a look at the | |
37 | files in the docs/ directory. You may need to install the texlive-fonts-extra | |
38 | packages from your distribution to compile some of the LaTeX documentation | |
39 | files. | |
40 | ||
174d1640 C |
41 | ** Runtime dependencies under Debian/Ubuntu** |
42 | ||
43 | - For the OCaml scripting feature in SmPL | |
44 | ocaml-native-compilers | |
45 | or ocaml-nox |