simplify make.sh & enable 'uninstall' option

This commit is contained in:
Nguyen Anh Quynh 2014-01-28 11:14:55 +08:00
parent 8ce50e4b49
commit af87393174
1 changed files with 4 additions and 10 deletions

14
make.sh
View File

@ -6,11 +6,7 @@
# Note: to cross-compile "nix32" on Linux, package gcc-multilib is required.
function build {
if [ ${MAKE}x = x ]; then
MAKE=make
fi
CROSS= ${MAKE} clean
${MAKE} clean
if [ ${CC}x != x ]; then
${MAKE} CC=$CC
@ -20,10 +16,6 @@ function build {
}
function install {
if [ ${MAKE}x = x ]; then
MAKE=make
fi
if [ ${CC}x != x ]; then
${MAKE} CC=$CC install
else
@ -31,6 +23,7 @@ function install {
fi
}
MAKE=make
if [ "$(uname)" == "SunOS" ]; then
export MAKE=gmake
export INSTALL_BIN=ginstall
@ -46,6 +39,7 @@ case "$1" in
"" ) build;;
"default" ) build;;
"install" ) install;;
"uninstall" ) ${MAKE} uninstall;;
"nix32" ) CFLAGS=-m32 LDFLAGS=-m32 build;;
"cross-win32" ) CROSS=i686-w64-mingw32- build;;
"cross-win64" ) CROSS=x86_64-w64-mingw32- build;;
@ -53,5 +47,5 @@ case "$1" in
"cygwin-mingw64" ) CROSS=x86_64-w64-mingw32- build;;
"clang" ) CC=clang build;;
"gcc" ) CC=gcc build;;
* ) echo "Usage: make.sh [nix32|cross-win32|cross-win64|cygwin-mingw32|cygwin-mingw64|clang|gcc]"; exit 1;;
* ) echo "Usage: make.sh [nix32|cross-win32|cross-win64|cygwin-mingw32|cygwin-mingw64|clang|gcc|install|uninstall]"; exit 1;;
esac