forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsdk.sh
executable file
·41 lines (38 loc) · 853 Bytes
/
sdk.sh
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
#!/bin/sh
WRKDIR=/tmp
SDKDIR=${WRKDIR}/r2-sdk
if [ -n "$1" ]; then
if [ -f "$1" ]; then
echo "Target directory exists. Cant build the SDK in there"
exit 1
fi
SDKDIR="$1"
fi
# Builds an SDK to build stuff for rbin
export CFLAGS="-Os -fPIC"
make mrproper
if [ -z "${R2_PLUGINS_CFG}" ]; then
R2_PLUGINS_CFG=plugins.bin.cfg
fi
cp -f "${R2_PLUGINS_CFG}" plugins.cfg
#./configure-plugins
./configure --prefix="$PREFIX" --with-nonpic --without-pic --without-gpl || exit 1
#--disable-loadlibs || exit 1
make -j8 || exit 1
rm -rf "${SDKDIR}"
mkdir -p "${SDKDIR}"/lib
rm -f libr/libr.a
cp -rf libr/include "${SDKDIR}"
FILES=`find libr shlr -iname '*.a'`
cp -f ${FILES} "${SDKDIR}"/lib
OS=`uname`
AR=`uname -m`
SF=r2sdk-${OS}-${AR}
(
cd ${WRKDIR}
mv r2-sdk ${SF}
zip -r ${SF}.zip ${SF}
)
mv ${WRKDIR}/${SF} .
mv ${WRKDIR}/${SF}.zip .
ln -fs ${SF} r2sdk