added cygwin targets to the script and made cross-win* targets explicit

This commit is contained in:
Daniel Godas-Lopez 2013-11-28 18:23:39 +00:00 committed by Nguyen Anh Quynh
parent 0f7c4325dd
commit cf05e118d5
2 changed files with 31 additions and 10 deletions

17
COMPILE
View File

@ -45,20 +45,29 @@ only following files:
if you want 64-bit binaries) are required.
- To cross-compile Windows 32-bit binary, simply run
$ ./compile.sh win32
$ ./compile.sh cross-win32
- To cross-compile Windows 64-bit binary, simply run
$ ./compile.sh win64
$ ./compile.sh cross-win64
Resulted files "capstone.dll" and "tests/test*.exe" can then be used on Windows machine.
(4) By default, gcc is used as compiler. If you want to use "clang" instead, compile
(4) To compile under Cygwin gcc-mingw-w64-i686 or x86_64-w64-mingw32 run:
- To compile Windows 32-bit binary under Cygwin, simply run
$ ./compile.sh cygwin-mingw32
- To compile Windows 64-bit binary under Cygwin, simply run
$ ./compile.sh cygwin-mingw64
(5) By default, gcc is used as compiler. If you want to use "clang" instead, compile
the code with:
$ ./compile.sh clang
(5) So far Python, Ruby, Ocaml, Java, C# and Go are supported by bindings. Look for the bindings
(6) So far, Python, Ruby, Ocaml, Java, C# and Go are supported by bindings. Look for the bindings
under directory bindings/, and refer to README file of corresponding languages.

View File

@ -3,11 +3,23 @@
# Capstone Disassembler Engine
# By Nguyen Anh Quynh <aquynh@gmail.com>, 2013>
function build {
CROSS= make clean
if [ ${CC}x != x ]; then
make CC=$CC
else
make
fi
}
case "$1" in
"" ) make clean; make;;
"nix32" ) make clean; CFLAGS=-m32 LDFLAGS=-m32 make;;
"clang" ) make clean; make CC=clang;;
"win32" ) make clean; make CROSS=i686-w64-mingw32- windows;;
"win64" ) make clean; make CROSS=x86_64-w64-mingw32- windows;;
* ) echo "Usage: compile.sh [nix32|clang|win32|win64]"; exit 1;;
"" ) build;;
"nix32" ) CFLAGS=-m32 LDFLAGS=-m32 build;;
"clang" ) CC=clang build;;
"cross-win32" ) CROSS=i686-w64-mingw32- build;;
"cross-win64" ) CROSS=x86_64-w64-mingw32- build;;
"cygwin-mingw32" ) CROSS=i686-pc-mingw32- build;;
"cygwin-mingw64" ) CROSS=x86_64-w64-mingw32- build;;
* ) echo "Usage: compile.sh [nix32|clang|cross-win32|cross-win64|cygwin-mingw32|cygwin-mingw64]"; exit 1;;
esac