-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·54 lines (44 loc) · 1020 Bytes
/
build
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
53
54
#!/bin/sh
# Copyright (C) 2013-2016 David 'Mokon' Bond, All Rights Reserved
OPTS=`getopt -o hbdri -l help,debug,rebuild,debug,release,install -- "$@"`
if [ $? != 0 ] ; then
echo error
exit -1
fi
eval set -- "$OPTS"
if [ -f Makefile ] ; then
REBUILD=0
else
REBUILD=1
fi
DEBUG=1
INSTALL=0
while true ; do
case "$1" in
-h|--help|--usage|\?) echo "usage" && exit 0 ;;
-b|--rebuild) REBUILD=1 ; shift ;;
-d|--debug) DEBUG=1 ; shift ;;
-r|--release) DEBUG=0 ; shift ;;
-i|--install) INSTALL=0 ; shift ;;
--) shift ; break ;;
*) echo error; exit 1;;
esac
done
shift $((OPTIND-1))
[ "$1" = "--" ] && shift
reset
if [ $REBUILD -ne 0 ] ; then
if [ -f configure ] ; then
make clean-purge
fi
./bootstrap
if [ $DEBUG -ne 0 ] ; then
./configure --disable-static --enable-shared --enable-debug --prefix=/
else
./configure --disable-static --enable-shared --disable-debug --prefix=/
fi
fi
make
if [ $INSTALL -ne 0 ] ; then
sudo make install
fi