forked from douchey01Cuppa/SPFT_Source
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.sh
More file actions
41 lines (34 loc) · 782 Bytes
/
make.sh
File metadata and controls
41 lines (34 loc) · 782 Bytes
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
#!/bin/sh
usage() {
echo
echo usage:
echo ./make.sh [release/debug] [clean]
}
if [ $# -gt 2 ]
then
echo error: amount of arguments is $#, greater than 2.
usage
exit 1
fi
build_type=$1
clean_flag=$2
if [ -z "${build_type}" ]
then
echo build type default set to debug.
build_type=debug
fi
echo hint: BUILD TYPE is ${build_type}
echo hint: clean flag is ${clean_flag}
if [ "${build_type}" != debug ] && [ "${build_type}" != release ]
then
echo error: first argument is build type, valid value should be release or debug.
usage
exit 2
fi
if [ "${clean_flag}" != "" ] && [ "${clean_flag}" != clean ]
then
echo error: second argument indicates clean or not, valid value should be clean or empty.
usage
exit 2
fi
make HOST=linux BUILD_TYPE=${build_type} ${clean_flag}