-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bash
More file actions
executable file
·64 lines (56 loc) · 1.15 KB
/
build.bash
File metadata and controls
executable file
·64 lines (56 loc) · 1.15 KB
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
#!/bin/bash
if [ $# -ne 0 -a $# -ne 1 ]
then
echo "Usage: $0 [all|test|clean]"
exit 1
fi
OPT=${1}
if [ $# -eq 0 ]
then
OPT="all"
fi
if [ ${OPT} = "clean" ]
then
rm -rf ./cmake-build/*
rm -rf ./log/*
exit 0
fi
OS_TYPE="posix"
if [ `uname` = "Darwin" ]
then
:
else
uname -a | grep Linux > /dev/null
if [ $? -ne 0 ]
then
OS_TYPE="win"
fi
fi
DEFAULT_HAKO_PDU_CHANNEL_MAX=8192
if [ -n "${CHANNEL_MAX:-}" ] && [ "${CHANNEL_MAX}" -gt 0 ]; then
:
else
CHANNEL_MAX=${DEFAULT_HAKO_PDU_CHANNEL_MAX}
fi
echo "CHANNEL_MAX is ${CHANNEL_MAX}"
mkdir -p cmake-build
cd cmake-build
if [ ${OPT} = "test" ]
then
if [ ${OS_TYPE} = "posix" ]
then
cmake -D test=true -D debug=true -D gcov=true -D HAKO_PDU_CHANNEL_MAX=${CHANNEL_MAX} .. ${OS_OPT}
else
cmake -G "Unix Makefiles" -D WIN32=true -D test=true -D debug=true -D gcov=true .. ${OS_OPT}
fi
make
make test -d
else
if [ ${OS_TYPE} = "posix" ]
then
cmake -D test=false -D debug=true -D gcov=false -D HAKO_PDU_CHANNEL_MAX=${CHANNEL_MAX} ..
else
cmake .. -G "Unix Makefiles" -D WIN32=true
fi
make
fi