forked from youki-dev/youki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·43 lines (33 loc) · 870 Bytes
/
build.sh
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
#!/bin/bash
set -e
ROOT=$(git rev-parse --show-toplevel)
usage_exit() {
echo "Usage: $0 [-r] [-o dir]" 1>&2
exit 1
}
VERSION=debug
TARGET=x86_64-unknown-linux-gnu
while getopts ro:h OPT; do
case $OPT in
o) output=${OPTARG}
;;
r) VERSION=release
;;
h) usage_exit
;;
\?) usage_exit
;;
esac
done
shift $((OPTIND - 1))
OPTION=""
if [ ${VERSION} = release ]; then
OPTION="--${VERSION}"
fi
OUTPUT=${output:-$ROOT/bin}
[ ! -d $OUTPUT ] && mkdir -p $OUTPUT
cargo build --target ${TARGET} ${OPTION} --bin youki
cargo build --target ${TARGET} ${OPTION} --bin integration_test
RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} --bin runtimetest
mv ${ROOT}/target/${TARGET}/${VERSION}/{youki,integration_test,runtimetest} ${OUTPUT}/
exit 0