blob: 627234386d4aaaa52b8fada021b433ef093e33a2 [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
Nguyen Anh Quynh2cd33702013-12-02 20:32:41 +080017- On 64-bit OS, run command below to cross-compile Capstone for 32-bit binary:
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080018
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
Nguyen Anh Quynh2cd33702013-12-02 20:32:41 +080029Users are then required to enter root password to copy Capstone into machine
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080030system 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)
Nguyen Anh Quynh04271222013-12-09 11:12:47 +080041 /usr/lib/libcapstone.a
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080042
43
44
45(3) To cross-compile for Windows, Linux & gcc-mingw-w64-i686 (and also gcc-mingw-w64-x86-64
Nguyen Anh Quynh2cd33702013-12-02 20:32:41 +080046for 64-bit binaries) are required.
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080047
48 - To cross-compile Windows 32-bit binary, simply run
Daniel Godas-Lopezcf05e112013-11-28 18:23:39 +000049 $ ./compile.sh cross-win32
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080050
51 - To cross-compile Windows 64-bit binary, simply run
Daniel Godas-Lopezcf05e112013-11-28 18:23:39 +000052 $ ./compile.sh cross-win64
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080053
54Resulted files "capstone.dll" and "tests/test*.exe" can then be used on Windows machine.
55
56
57
Daniel Godas-Lopezcf05e112013-11-28 18:23:39 +000058(4) To compile under Cygwin gcc-mingw-w64-i686 or x86_64-w64-mingw32 run:
59
60 - To compile Windows 32-bit binary under Cygwin, simply run
61 $ ./compile.sh cygwin-mingw32
62
63 - To compile Windows 64-bit binary under Cygwin, simply run
64 $ ./compile.sh cygwin-mingw64
65
66
Nguyen Anh Quynh2cd33702013-12-02 20:32:41 +080067(5) By default, gcc is used as compiler. To use "clang" compiler instead, run command below:
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080068
Nguyen Anh Quynh46e8ca82013-11-28 10:10:50 +080069 $ ./compile.sh clang
Nguyen Anh Quynh26ee41a2013-11-27 12:11:31 +080070
71
Nguyen Anh Quynh676cabd2013-12-02 20:23:35 +080072(6) So far, Python, Ruby, Ocaml, Java, C# and Go are supported by bindings. Look for
73the bindings under directory bindings/, and refer to README file of corresponding languages.
74