#!/bin/sh

from_makefile ()
{
	temp=`grep "^$1" $2|cut -d= -f2-|sed 's/(\|)//g'`
	sh -c "echo $temp"
}

ARGS=`echo $@|sed -e 's/-O[s0-9]//g' -e 's/-fpermissive//g'`
export MATLAB=`from_makefile MATLAB ../config.mak`
MEX=`from_makefile MEX ../config.mak`
$MEX $ARGS
