radare2/sys/install.sh

37 lines
730 B
Bash
Raw Normal View History

#!/bin/sh
MAKE=make
gmake --help >/dev/null 2>&1
[ $? = 0 ] && MAKE=gmake
[ -z "${INSTALL_TARGET}" ] && INSTALL_TARGET=symstall
# find root
2015-06-17 03:47:36 +00:00
cd "$(dirname "$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
2014-11-23 21:11:41 +00:00
fi
else
shift
fi
2015-06-17 03:47:36 +00:00
[ "$(id -u)" = 0 ] || SUDO=sudo
[ -n "${NOSUDO}" ] && SUDO=
if [ "${HARDEN}" = 1 ]; then
2015-06-17 03:47:36 +00:00
# shellcheck disable=SC2048
# shellcheck disable=SC2086
./sys/build-harden.sh $* && ${SUDO} ${MAKE} ${INSTALL_TARGET}
else
2015-06-17 03:47:36 +00:00
# shellcheck disable=SC2048
# shellcheck disable=SC2086
./sys/build.sh $* && ${SUDO} ${MAKE} ${INSTALL_TARGET}
fi