1
0
Fork 0
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:
utam0k 2022-03-13 21:43:13 +09:00
parent 54bb830b4b
commit 17d7303c26
No known key found for this signature in database
GPG Key ID: 14ACDDE088DF059E
3 changed files with 38 additions and 6 deletions

View File

@ -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

View File

@ -7,4 +7,4 @@ release:
cargo build --release && cp ./target/release/youki ./youki_bin
clean:
rm ./youki_bin
rm ./youki_bin

View File

@ -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