From f40b72cabf3f34f07373a1c43a0b87f62c62f577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Fri, 29 Jun 2018 15:39:58 +0200 Subject: [PATCH] Add script to easily build for multiple targets --- make-target | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 make-target diff --git a/make-target b/make-target new file mode 100755 index 0000000..c33e76d --- /dev/null +++ b/make-target @@ -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"