| #!/bin/bash |
| |
| set -e |
| set -o errtrace |
| trap 'echo Fatal error: script $0 aborting at line $LINENO, command \"$BASH_COMMAND\" returned $?; exit 1' ERR |
| |
| if [ $# -eq 1 ]; then |
| EUREKA_SRC_DIR=$(readlink -e $1) |
| fi |
| |
| ################################################### |
| # Setup build toollchain |
| ################################################### |
| TOP_DIR=$(readlink -e $(dirname $0)/../../..) |
| |
| # It exports ARCH and other build related envs. |
| ENABLE_64BIT_BUILD=false |
| source ${TOP_DIR}/sdk/build_scripts/setup_env.sh |
| |
| TARGET_STRIP=${CROSS_COMPILE}strip |
| |
| ################################################## |
| # Build perf |
| ################################################## |
| mkdir -p output |
| make clean |
| make O=output V=1 |
| |
| # strip and install into Eureka source tree |
| ${TARGET_STRIP} --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version output/perf -o output/perf_stripped |
| |
| if [ "${EUREKA_SRC_DIR}" != "" ]; then |
| cp -f output/perf_stripped "${EUREKA_SRC_DIR}"/vendor/qualcomm/sirocco/prebuilt/sdk/usr/bin/perf |
| rm -rf output |
| fi |
| |