mirror of
https://github.com/containers/youki
synced 2024-05-24 00:16:08 +02:00
Make relase and debug optional in scripts/build.rs
This commit is contained in:
parent
54bb830b4b
commit
17d7303c26
5
Makefile
5
Makefile
|
@ -1,7 +1,10 @@
|
|||
ROOT = $(shell git rev-parse --show-toplevel)
|
||||
|
||||
build:
|
||||
./scripts/build.sh $(ROOT)
|
||||
./scripts/build.sh -o $(ROOT)
|
||||
|
||||
release-build:
|
||||
./scripts/build.sh -o $(ROOT) -r
|
||||
|
||||
test-all: test oci-integration-test integration-test
|
||||
|
||||
|
|
|
@ -7,4 +7,4 @@ release:
|
|||
cargo build --release && cp ./target/release/youki ./youki_bin
|
||||
|
||||
clean:
|
||||
rm ./youki_bin
|
||||
rm ./youki_bin
|
||||
|
|
|
@ -1,16 +1,45 @@
|
|||
#! /bin/sh -eu
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ROOT=$(git rev-parse --show-toplevel)
|
||||
OUTPUT=${1:-$ROOT/bin}
|
||||
|
||||
usage_exit() {
|
||||
echo "Usage: $0 [-r] [-o dir]" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
VERSION=debug
|
||||
|
||||
# while getopts orh OPT; do
|
||||
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))
|
||||
|
||||
OUTPUT=${output:-$ROOT/bin}
|
||||
[ ! -d $OUTPUT ] && mkdir -p $OUTPUT
|
||||
|
||||
cd ${ROOT}/crates
|
||||
make release
|
||||
make ${VERSION}
|
||||
mv ./youki_bin ${OUTPUT}/youki
|
||||
|
||||
cd ${ROOT}/tests/rust-integration-tests
|
||||
make FLAG=--release all
|
||||
if [ ${VERSION} = release ]; then
|
||||
make FLAG=--${VERSION} all
|
||||
else
|
||||
make all
|
||||
fi
|
||||
mv ./runtimetest_bin ${OUTPUT}/runtimetest
|
||||
mv ./integration_test_bin ${OUTPUT}/integration_test
|
||||
|
||||
|
|
Loading…
Reference in New Issue