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