Add script to easily build for multiple targets

This commit is contained in:
Théophile Bastian 2018-06-29 15:39:58 +02:00
parent 67035cd071
commit f40b72cabf

43
make-target Executable file
View file

@ -0,0 +1,43 @@
#!/bin/bash
case "$1" in
'eh_elf')
TARGET='eh_elf'
LIBUNWIND='eh_elf'
branch='eh_elf'
;;
'vanilla')
TARGET='vanilla'
LIBUNWIND='vanilla'
branch='vanilla_timer'
;;
'vanilla-nocache')
TARGET='vanilla-nocache'
LIBUNWIND='vanilla'
branch='vanilla_timer_nocache'
;;
*)
>&2 echo "Usage: $0 [ eh_elf | vanilla | vanilla-nocache ]"
exit 1
esac
original_branch=$(git rev-parse --abbrev-ref HEAD)
if ! git checkout "$branch" ; then
>&2 echo "Failed to checkout $branch - maybe your git isn't clean?"
exit 2
fi
LIBUNWIND_PREFIX="$HOME/local/libunwind-$LIBUNWIND-dbg"
LIBUNWIND_LIB="$LIBUNWIND_PREFIX/lib"
PREFIX="$HOME/local/perf-$TARGET"
export CPATH=$LIBUNWIND_PREFIX/include
export LD_LIBRARY_PATH=$LIBUNWIND_LIB
export EXTRA_CFLAGS=-L$LIBUNWIND_LIB
make -j
mkdir -p $PREFIX/bin
cp "perf" "$PREFIX/bin/"
git checkout "$original_branch"