-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·66 lines (57 loc) · 1.37 KB
/
make.sh
File metadata and controls
executable file
·66 lines (57 loc) · 1.37 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
65
66
#!/bin/bash
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
RELEASE_DIR=$SCRIPT_DIR/release
usage() {
echo "Usage: $0 [options] "
echo " "
echo "Supported options: "
echo "-a, --all Build nativ and aarch64 cross "
echo "-c, --cross Build aarch64 cross "
}
build()
{
BUILD_DIR=${SCRIPT_DIR}/build_$1
rm -Rf ${BUILD_DIR}
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../toolchain/$2.cmake ..
cmake --build .
mkdir -p ${RELEASE_DIR}
tar -zcvf ${RELEASE_DIR}/v4l2-test-0.3.0-linux-$1.tar.gz v4l2-test
}
build_generic()
{
build generic gnu-generic-toolchain
}
build_x86-64()
{
build x86-64 gnu-generic-toolchain
}
build_arm64()
{
build arm64 aarch64-cross-toolchain
}
while [ $# != 0 ] ; do
option="$1"
shift
case "${option}" in
-a|--all)
build_x86-64
build_arm64
exit 0
;;
-c|--cross)
build_arm64
exit 0
;;
-h|--help)
usage
exit 0
;;
*)
echo "Unknown option ${option}"
exit 1
;;
esac
done
build_generic