2011-09-10 00:19:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-07-02 21:15:40 +00:00
|
|
|
MAKE=make
|
|
|
|
gmake --help >/dev/null 2>&1
|
|
|
|
[ $? = 0 ] && MAKE=gmake
|
|
|
|
|
2015-04-30 21:18:56 +00:00
|
|
|
[ -z "${INSTALL_TARGET}" ] && INSTALL_TARGET=symstall
|
|
|
|
|
2011-09-10 00:19:06 +00:00
|
|
|
# find root
|
2015-06-17 03:47:36 +00:00
|
|
|
cd "$(dirname "$0")" ; cd ..
|
2011-09-10 00:19:06 +00:00
|
|
|
|
|
|
|
# update
|
2014-12-14 01:36:57 +00:00
|
|
|
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
|
2014-12-14 01:36:57 +00:00
|
|
|
else
|
|
|
|
shift
|
2011-09-10 00:19:06 +00:00
|
|
|
fi
|
|
|
|
|
2015-08-24 11:25:04 +00:00
|
|
|
type sudo || NOSUDO=1
|
2015-06-17 03:47:36 +00:00
|
|
|
[ "$(id -u)" = 0 ] || SUDO=sudo
|
2013-05-02 21:49:58 +00:00
|
|
|
[ -n "${NOSUDO}" ] && SUDO=
|
2012-08-27 15:02:58 +00:00
|
|
|
|
2015-09-14 17:21:57 +00:00
|
|
|
if [ "${M32}" = 1 ]; then
|
|
|
|
./sys/build-m32.sh $* && ${SUDO} ${MAKE} ${INSTALL_TARGET}
|
|
|
|
elif [ "${HARDEN}" = 1 ]; then
|
2015-06-17 03:47:36 +00:00
|
|
|
# shellcheck disable=SC2048
|
|
|
|
# shellcheck disable=SC2086
|
2015-04-30 21:18:56 +00:00
|
|
|
./sys/build-harden.sh $* && ${SUDO} ${MAKE} ${INSTALL_TARGET}
|
2013-09-27 17:50:48 +00:00
|
|
|
else
|
2015-06-17 03:47:36 +00:00
|
|
|
# shellcheck disable=SC2048
|
|
|
|
# shellcheck disable=SC2086
|
2015-04-30 21:18:56 +00:00
|
|
|
./sys/build.sh $* && ${SUDO} ${MAKE} ${INSTALL_TARGET}
|
2013-09-27 17:50:48 +00:00
|
|
|
fi
|