Allow stage function

This commit is contained in:
Jeremy Soller 2016-11-01 16:05:16 -06:00
parent f00ab6f018
commit d1ff741b28
2 changed files with 21 additions and 3 deletions

18
cook.sh
View File

@ -42,11 +42,23 @@ function op {
popd > /dev/null
;;
stage)
mkdir -p stage/bin
mkdir -p stage
pushd build > /dev/null
if [ "$(type -t recipe_stage)" = "function" ]
then
recipe_stage ../stage
fi
#TODO xargo install --root "../stage" $CARGOFLAGS
cp -v $(find target/x86_64-unknown-redox/debug/ -maxdepth 1 -type f ! -name "*.*") ../stage/bin
strip -v ../stage/bin/*
bins="$(find target/x86_64-unknown-redox/debug/ -maxdepth 1 -type f ! -name '*.*')"
if [ -n "$bins" ]
then
mkdir -p ../stage/bin
for bin in $bins
do
cp -v "$bin" "../stage/bin/$(basename $bin)"
strip -v "../stage/bin/$(basename $bin)"
done
fi
popd > /dev/null
;;
unstage)

View File

@ -0,0 +1,6 @@
GIT=https://github.com/jackpot51/pixelcannon.git
function recipe_stage {
mkdir -pv "$1/apps/pixelcannon"
cp -Rv assets "$1/apps/pixelcannon"
}