-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·104 lines (92 loc) · 3.13 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/sh
#--------------------------------------------------------------------------------
# Stylus Project
#
# Build script to ease building Stylus
#
# Stylus, Copyright 2006-2009 Biologic Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#--------------------------------------------------------------------------------
if [ -f ./configure.ac ] ; then
fullmode=on
else
fullmode=off
fi
mflags=""
status=0
debug=off
release=off
profile=off
install=off
verbose=on
make_args=
usage()
{
echo "$(basename $0): Script to build Stylus"
echo "Usage: $(basename $0) \"options\""
echo " where options may be any of the following:"
echo " -a | -all | --a | --all : Make all Stylus versions"
echo " -d | -debug | --d | --debug : Make a Stylus debug build"
echo " -r | -release | --r | --release : Make a Stylus release build"
echo " -p | -profile | --p | --profile : Make a Stylus profile build (measured)"
echo " -c | -clean | --c | --clean : Clean the build products"
echo " -q | -quiet | --q | --quiet : Silence output"
echo " -h | -help | --h | --help : Show this help text"
echo " - | -- : Pass all following arguments to make unmodified"
echo ""
echo " The default builds the RELEASE version"
exit 1
}
until [ -z "$1" ]
do
case $1 in
-a | -all | --a | --all) debug=on; release=on; profile=on;;
-d | -debug | --d | --debug) debug=on;;
-r | -release | --r | --release) release=on;;
-p | -profile | --p | --profile) profile=on;;
-c | -clean | --c | --clean) target="clean";;
-q | -quite | --q | --quite) verbose=off;;
-h | -help | --h | --help) usage;;
- | --) shift; make_args=$*; break;;
esac
shift
done
if [ $debug = "off" ] && [ $release = "off" ] && [ $profile = "off" ] ; then
release="on"
fi
if [ $verbose = "off" ] ; then
mflags="$mflags --silent"
fi
if [ $status -lt 1 ] && [ $debug = "on" ] ; then
echo "Build obj/debug $target ----------------------------------------------------------------------------"
pushd obj/debug
make $mflags $make_args
status=$?
popd
fi
if [ $status -lt 1 ] && [ $release = "on" ] ; then
echo "Build obj/release $target --------------------------------------------------------------------------"
pushd obj/release
make $mflags $make_args
status=$?
popd
fi
if [ $status -lt 1 ] && [ $profile = "on" ] ; then
echo "Build obj/profile $target --------------------------------------------------------------------------"
pushd obj/profile
make $mflags $make_args
status=$?
popd
fi
exit $status