#!/bin/sh

. config/options $1

cd $PKG_BUILD

make -C src \
     INSTALL_TOP=/usr \
     PLAT=linux \
     CC=$TARGET_CC \
     AR="$TARGET_AR rcu" \
     RANLIB=$TARGET_RANLIB \
     liblua.a

mkdir -p $SYSROOT_PREFIX/usr/lib
  cp src/liblua.a $SYSROOT_PREFIX/usr/lib

mkdir -p $SYSROOT_PREFIX/usr/include
  cp src/lua.h $SYSROOT_PREFIX/usr/include
  cp src/luaconf.h $SYSROOT_PREFIX/usr/include
  cp src/lualib.h $SYSROOT_PREFIX/usr/include
  cp src/lauxlib.h $SYSROOT_PREFIX/usr/include
  cp etc/lua.hpp $SYSROOT_PREFIX/usr/include
