#!/bin/sh
. ./build.cfg
CPWD=`pwd`
CPACKED="$CPWD/packed.bin"

if test ! -x "$CPACKED"; then
	make -f Makefile clean
	make -f Makefile EXEEXT=".bin" TOOL_BINPATH="$CPWD/" "$CPACKED"
fi

cd "$CPWD/data" && $CPACKED -c -p "$CPWD/$CBINPATH/$CPACKFILE" *

if test ! -e "$CPWD/$CPACKFILE"; then
	ln -s "$CPWD/$CBINPATH/$CPACKFILE" "$CPWD/$CPACKFILE"
fi
