permit multiline comments and strings in macros
[bpt/coccinelle.git] / readme.txt
1 Coccinelle
2
3
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.
9 Once you have installed coccinelle, there is a script 'spatch' in /usr/bin
10 or /usr/local/bin that invokes the Coccinelle program.
11
12 If you want to run Coccinelle without installing it, you can run the
13 Coccinelle program directly from the download/build directory. You may then
14 have to setup a few environment variables so that the Coccinelle program
15 knows where to find its configuration files.
16 For bash do:
17
18 $ source env.sh
19
20 For tcsh do:
21
22 $ source env.csh
23
24
25 You can test coccinelle with:
26
27 $ spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
28
29 If you haven't installed coccinelle, run then ./spatch or ./spatch.opt
30
31
32
33 If you downloaded the bytecode version of spatch you may first
34 have to install OCaml (which contains the 'ocamlrun' bytecode interpreter,
35 the equivalent of 'java', the Java virtual machine, but for OCaml) and then do:
36
37 $ ocamlrun spatch -sp_file demos/simple.cocci demos/simple.c -o /tmp/new_simple.c
38
39
40 For more information on Coccinelle, type 'make docs' and have a look at the
41 files in the docs/ directory. You may need to install the texlive-fonts-extra
42 packages from your distribution to compile some of the LaTeX documentation
43 files.
44
45 ** Runtime dependencies under Debian/Ubuntu**
46
47 - For the OCaml scripting feature in SmPL
48 ocaml-native-compilers
49 or ocaml-nox