#!/bin/sh

CXX=${CXX:-g++}

if [ "$1" = "clean" ]
then
	( cd `dirname $0`; rm -f *.cpp *.so *.o mlt.i ../.php mlt.php *.h )
	exit 0
fi


ln -sf ../mlt.i
swig -c++ -I../../mlt++ -I../.. -php5 -noproxy mlt.i
${CXX} -fPIC -DPIC -D_GNU_SOURCE ${CXXFLAGS} -c -rdynamic -pthread -I../.. `php-config --includes` mlt_wrap.cpp
${CXX} ${CXXFLAGS} -shared mlt_wrap.o -L../../mlt++ -lmlt++ -o mlt.so || exit $?
