-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·47 lines (44 loc) · 1.09 KB
/
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
#!/bin/bash
#
# build - compile and optionally install MusicPlayerPlus components
#
usage() {
printf "\nUsage: ./build [-i] [-d destdir] [-p prefix] [-u] project [project2 ...]"
printf "\nWhere:"
printf "\n\t-i indicates install"
printf "\n\t-d destdir specifies installation destdir (default /)"
printf "\n\t-p prefix specifies installation prefix (default /usr)"
printf "\n\t-u displays this usage message and exits\n"
printf "\n'project' can be one or more of:"
printf "\n\t'mmtc', 'mpq', 'nncmpp', 'pms', 'songmem'\n"
exit 1
}
INSTALL=
PREFIX=
DESTDIR=
while getopts "d:ip:u" flag; do
case $flag in
d)
DESTDIR="-d $OPTARG"
;;
i)
INSTALL="-i"
;;
p)
PREFIX="-p $OPTARG"
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
for project in $*
do
if [ -x scripts/build-${project}.sh ]
then
scripts/build-${project}.sh ${INSTALL} ${DESTDIR} ${PREFIX}
else
echo "ERROR: Unrecognized project ${project}. No build script."
fi
done