forked from radareorg/radare2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.sh
executable file
·52 lines (45 loc) · 919 Bytes
/
user.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
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
MAKE=make
gmake --help >/dev/null 2>&1
[ $? = 0 ] && MAKE=gmake
# find root
cd "$(dirname "$PWD/$0")" ; cd ..
# update
if [ "$1" != "--without-pull" ]; then
if [ -d .git ]; then
git branch | grep "^\* master" > /dev/null
if [ $? = 0 ]; then
echo "WARNING: Updating from remote repository"
git pull
fi
fi
else
shift
fi
if [ -z "${HOME}" ]; then
echo "HOME not set"
exit 1
fi
if [ ! -d "${HOME}" ]; then
echo "HOME is not a directory"
exit 1
fi
ROOT="${HOME}/bin/prefix/radare2/"
mkdir -p "${ROOT}/lib"
if [ "${M32}" = 1 ]; then
./sys/build-m32.sh "${ROOT}" && ${MAKE} symstall
elif [ "${HARDEN}" = 1 ]; then
./sys/build-harden.sh "${ROOT}" && ${MAKE} symstall
else
./sys/build.sh "${ROOT}" && ${MAKE} symstall
fi
if [ $? != 0 ]; then
echo "Oops"
exit 1
fi
${MAKE} user-install
echo
echo "radare2 is now installed in ${HOME}/bin"
echo
echo "Now add ${HOME}/bin to your PATH"
echo