# copy template makefile
src_dir=$(dirname $0)
cp $src_dir/Makefile.in Makefile

# update makefile
sed -e 's#@src_dir@#'$src_dir'#g' Makefile > Makefile.tmp && mv Makefile.tmp Makefile