default: em em_mex

clean:
	rm -f *.o em

# Set these variables to the point to the correct locations
CBLAS_LIB=/Volumes/MachSAN/home/jake/gsl-1.11/cblas/.libs
GSL_LIB=/Volumes/MachSAN/home/jake/gsl-1.11/.libs
GSL_INCLUDE=/Volumes/MachSAN/home/jake/gsl-1.11
MATLAB=/Applications/MATLAB_R2009b.app

em_mex: em_mex.c em.c data.c data.h prob_functions.c prob_functions.h
	$(MATLAB)/bin/mex $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -arch=maci64 em_mex.c em.c data.c prob_functions.c

em: em.c data.c data.h prob_functions.c prob_functions.h
	gcc -m64 -O3 $(GSL_LIB)/libgsl.a $(CBLAS_LIB)/libgslcblas.a -I$(GSL_INCLUDE) -std=c99 -o em em.c data.c prob_functions.c
