# Use MinGW Make to process this file. Y must provide your sytem system specific MATLABROOT
# variable on the command line e.g.:
#
# make -f Makefile_mingw64 MATLABROOT="C:\Program Files\MATLAB\R2011b" ARCH=win64

ifndef MATLABROOT
  $(warning MATLABROOT variable is undefined. Using default MATLABROOT="C:\Program Files\MATLAB\R2011b" )
  MATLABROOT=C:\Program Files\MATLAB\R2011b
endif

ifndef ARCH
  $(warning ARCH variable is undefined. Using default ARCH=win64 )
  ARCH=win64
endif

MEXCOMPFLAGS=-I"$(MATLABROOT)\extern\include"
MATLABLIBS=-lmat -lmx
MATLABLINKFLAGS=-L"$(MATLABROOT)\bin\$(ARCH)" $(MATLABLIBS)

CC=gcc

CFLAGS=-g -std=c99 -I../../src/thirdparty -I../../src/ -I./ -L../../mex/

EXEFILES=mexExecuter.exe

all: $(EXEFILES) copyLibs

%.exe: %.c
	$(CC) $(CFLAGS) $(MEXCOMPFLAGS) $< -o $@ -static-libgcc $(MATLABLINKFLAGS) -lfftw3-3 -lfftw3f-3

copyLibs:
	copy /Y ..\..\mex\libfftw3-3.dll .
	copy /Y ..\..\mex\libfftw3f-3.dll .
	copy /Y ..\..\mex\ltfat.dll .
	copy /Y ..\..\mex\ltfatf.dll .	
	
	
clean:

.PHONY: all clean


