-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·52 lines (44 loc) · 978 Bytes
/
build.sh
File metadata and controls
executable file
·52 lines (44 loc) · 978 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
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
###set Global PATHs
TOPDIR=`pwd`
###set PATH only used in this script
DESTDIR=$TOPDIR
SAMPLEDIR=$TOPDIR/sample
TLVPROTODIR=$TOPDIR/src/csmpagent/tlvs
export OS=$1
build_header()
{
echo "########## generating protobuf header files...##########"
make $OS -C $TLVPROTODIR
}
build_sample()
{
make $OS -C $SAMPLEDIR
}
build_lib()
{
make $OS -C $DESTDIR
rm -f *.o
[ ! -f csmp_agent_lib.a ] || mv csmp_agent_lib.a sample/
[ ! -f csmp_agent_lib_freertos.a ] || mv csmp_agent_lib_freertos.a sample/
[ ! -f csmp_agent_lib_efr32_wisun.a ] || mv csmp_agent_lib_efr32_wisun.a sample/
}
clean_all()
{
make clean -C $DESTDIR
make clean -C $SAMPLEDIR
# make clean -C $TLVPROTODIR
rm -rf $DESTDIR/build
rm -f $DESTDIR/*.a
rm -f $SAMPLEDIR/*.a
}
if [ "$1"x = "clean"x ];then
echo "########## start cleaning...##########"
clean_all;
else
echo "########## start building...##########"
clean_all;
# build_header;
build_lib;
build_sample;
fi