blob: 8bb759e79783056a38f86ebdd1729c011b127969 [file] [log] [blame]
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +08001How To Compile & Run Capstone for Linux, Mac OSX, *nix and Windows
2 *-*-*-*-*-*
3
4
5Capstone requires no prerequisite packages, so it is easy to compile & install.
6
7
8(1) On Linux, Mac OSX or *nix:
9
10- To compile for current platform, run either:
11 $ ./compile.sh
12 or:
13 $ make
14
15 Then run "./tests/test*" to see the tests disassembling sample code.
16
17- On 64-bit OS, if you want to cross-compile Capstone for 32-bit binary, run:
18
19 $ ./compile.sh nix32
20
21 Then similarly, run "./tests/test*" to see the tests disassembling sample code.
22
23
24
25(2) To install Capstone, run:
26
27 $ sudo make install
28
29You are then required to enter root password to copy Capstone into machine
30system directories.
31
32NOTE: The core framework that will be installed by "make install" consist of
33only following files:
34
Patroklos Argyroudisa6503fe2013-11-27 14:25:34 +020035 /usr/include/capstone/capstone.h
36 /usr/include/capstone/x86.h
37 /usr/include/capstone/arm.h
38 /usr/include/capstone/arm64.h
39 /usr/include/capstone/mips.h
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080040 /usr/lib/libcapstone.so (for Linux/*nix), or /usr/lib/libcapstone.dylib (OSX)
41
42
43
44(3) To cross-compile for Windows, Linux & gcc-mingw-w64-i686 (and also gcc-mingw-w64-x86-64
45if you want 64-bit binaries) are required.
46
47 - To cross-compile Windows 32-bit binary, simply run
48 $ ./compile.sh win32
49
50 - To cross-compile Windows 64-bit binary, simply run
51 $ ./compile.sh win64
52
53Resulted files "capstone.dll" and "tests/test*.exe" can then be used on Windows machine.
54
55
56
57(4) By default, gcc is used as compiler. If you want to use "clang" instead, compile
58the code with:
59
60 $ ./compile clang
61
62
63(5) So far, Python, Ruby, Ocaml, Java, C# and Go are supported by bindings. Look for the bindings
64under directory bindings/, and refer to README file of corresponding languages.