Support for changing binary dir, support for doing binary staging after recipe_stage function

This commit is contained in:
Jeremy Soller 2017-01-09 16:47:32 -07:00
parent 20a53f60d3
commit 5c2e74c425

15
cook.sh
View File

@ -9,7 +9,8 @@ REPO="$ROOT/repo/$TARGET"
export CC="$ROOT/libc-artifacts/gcc.sh"
# Variables to be overriden by recipes
export CARGOFLAGS=--verbose
export BINDIR=bin
export CARGOFLAGS=
set -e
@ -68,19 +69,23 @@ function op {
stage)
mkdir -p stage
pushd build > /dev/null
skip_bins="0"
if [ "$(type -t recipe_stage)" = "function" ]
then
recipe_stage ../stage
else
skip_bins="$?"
fi
if [ "$skip_bins" -eq "0" ]
then
#TODO xargo install --root "../stage" $CARGOFLAGS
bins="$(find target/$TARGET/release/ -maxdepth 1 -type f ! -name '*.*')"
if [ -n "$bins" ]
then
mkdir -p ../stage/bin
mkdir -p "../stage/$BINDIR"
for bin in $bins
do
cp -v "$bin" "../stage/bin/$(basename $bin)"
#strip -v "../stage/bin/$(basename $bin)"
cp -v "$bin" "../stage/$BINDIR/$(basename $bin)"
#strip -v "../stage/$BINDIR/$(basename $bin)"
done
fi
fi