-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmake-rs.sh
executable file
·67 lines (57 loc) · 1.07 KB
/
make-rs.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
usage() {
echo "Usage: $0 [--rustpath RUST] [--version VERSION] [--parallel]" 1>&2
}
CARGO="cargo"
VERSION="1.0"
PARALLEL=""
while [[ "$#" -gt 0 ]]; do
case "$1" in
--rustpath)
shift
CARGO="$1"
shift
;;
--version)
shift
VERSION="$1"
shift
;;
--parallel)
shift
PARALLEL="--parallel"
;;
-help)
usage
exit 0
;;
kernel|user|linux)
WHAT=$1
shift
;;
*)
echo "unexpected argument $1"
usage
exit 1
esac
done
if [ $# -gt 0 ]; then
usage
exit 1
fi
ROOT=$(pwd)
OUTPATH=bin
mkdir -p $OUTPATH/kernel
mkdir -p $OUTPATH/user
LDF="-X sigmaos/sigmap.Target=$TARGET -s -w"
TARGETS="exec-uproc-rs spawn-latency"
# If building in parallel, build with (n - 1) threads.
njobs=$(nproc)
njobs="$(($njobs-1))"
build="parallel -j$njobs $CARGO \"build --manifest-path=rs/{}/Cargo.toml --release\" ::: $TARGETS"
echo $build
eval $build
#cp
# Copy rust bins
cp rs/exec-uproc-rs/target/release/exec-uproc-rs bin/kernel
cp rs/spawn-latency/target/release/spawn-latency bin/user/spawn-latency-v$VERSION