-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
executable file
·77 lines (69 loc) · 1.01 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
#!/bin/bash
TOPDIR=`pwd`
INCLUDE=$TOPDIR/include
OUTPUT=$TOPDIR/output
LIBREGEXDIR=$TOPDIR/regexParse
show_help() {
echo "Usage: $0 [option]"
echo -e "\t --all build all"
echo -e "\t --test build all and test"
echo -e "\t --clean-all clean"
echo ""
}
clean_all()
{
cd $TOPDIR/app_identify/loader
make clean
cd $LIBREGEXDIR
make clean
cd $TOPDIR/app_identify
make clean
}
build_pre() {
cd $TOPDIR/app_identify/loader
make
cd $TOPDIR
}
build_libregex() {
cd $LIBREGEXDIR
make
cd $TOPDIR
}
build_app_identify() {
build_pre
cd $TOPDIR/app_identify
make
cd $TOPDIR
}
build_test() {
cd output
./test sig.conf youku_tudou.pcap
}
if [ $# == 0 ]; then
build_libregex
build_app_identify
elif [ $# == 1 ]; then
case $1 in
--all)
build_libregex
build_app_identify
shift
;;
--test)
build_libregex
build_app_identify
build_test
shift
;;
--clean-all)
clean_all
shift
;;
*)
show_help
shift
;;
esac
else
show_help
fi