-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathcompile-cmake.command
executable file
·55 lines (43 loc) · 1.2 KB
/
compile-cmake.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# todo: use fakeroot
cd "$(dirname "$0")"
set -xe
cd submodules/capstone
make
cd ../..
cd submodules/unicorn
UNICORN_ARCHS="arm aarch64 x86" ./make.sh
cd ../..
cd submodules/keystone
mkdir -p build
cd build
../make-lib.sh
cd ../../..
cp submodules/capstone/libcapstone.a iblessing/iblessing-core/vendor/libs/
cp submodules/unicorn/libunicorn.a iblessing/iblessing-core/vendor/libs/
cp submodules/keystone/build/llvm/lib/libkeystone.a iblessing/iblessing-core/vendor/libs/
mkdir -p cmake-build
cd cmake-build
if [[ "$OSTYPE" == "darwin"* ]]; then
cmake -Diblessing.PLATFORM=macos ../iblessing
else
cmake -Diblessing.PLATFORM=linux ../iblessing
fi
cmake --build .
if [[ "$OSTYPE" == "darwin"* ]]; then
mv iblessing iblessing-darwin
mv iblessing-all iblessing-darwin-all
else
mv iblessing iblessing-linux
mv iblessing-all iblessing-linux-all
fi
cd ..
sh ./copy-headers.sh
cd cmake-build
if [[ "$OSTYPE" == "darwin"* ]]; then
tar -czvf iblessing-framework-darwin.tar.gz ./libiblessing-core.dylib include
else
tar -czvf iblessing-framework-linux.tar.gz ./libiblessing-core.so include
fi
cd ..
echo "[+] iblessing is in cmake-build directory~"