function make_mex_file;
% Makefile for Solaris

cd tools/mex_solaris

if (exist('out_mex') ~= 3),
        cd ../../src
	mex -c ts_tools.c
	mex out_mex.c ts_tools.o
	mex jacob_inputs.c ts_tools.o
	mex jacob_params.c ts_tools.o
    	mex -O ICmain.c ICclasses.c -o ICctrl.mexlx
    	mex -O simulation_error.c ICclasses.c -o simulate.mexlx
	mex lookup_out.c
	mex lookup_jac.c
        !mv *.mexsol ../tools/mex_solaris/
        cd ../tools/mex_solaris
end

if (exist('clqLL') ~= 3),
        cd ../../src
	mex -O clqLL.c
        !mv *.mexsol ../tools/mex_solaris/
        cd ../tools/mex_solaris
end

cd ../..

