#!/bin/sh

. config/options

cd $BUILD/$1*

install_dir="$PWD/.install"
install_dir_debug="$PWD/.install-debuginfo"

rm -rf "$install_dir"
mkdir -p "$install_dir"

if [ "$TARGET_MACHINE" = "beagleboard-xm" -o "$TARGET_MACHINE" = "igepv2-dm3730" ]; then
  ES=es5.x
else
  ES=es3.x
fi

cp -PR ${ES}/usr "$install_dir/usr"

strip_libs "$install_dir"     "$install_dir_debug/usr/lib/debug"
strip_bins "$install_dir/usr" "$install_dir_debug/usr/lib/debug"
