# Use GNU Make to process this file.

EXT = $(shell mexext)
# This line gets the MEX extension for the platform. If the shell
# command 'mexext' is not available on your Matlab installation,
# please execute the 'mexext' command within Matlab, and put the
# answer into the line below (remember to uncomment).
#EXT = $(glnx86)

MEXSC    = $(shell ls comp_*.c)
MEXSBASE = $(basename $(MEXSC))
MEXS     = $(addsuffix .$(EXT),$(MEXSBASE))

CFLAGS= -I../thirdparty -I. -I../src -L../lib


all:	$(MEXS)

%.$(EXT): %.c Makefile config.h ../lib/libltfat-nomem.a ../src/ltfat.h mex-memalloc.o
	mex $(CFLAGS) $< mex-memalloc.o -lfftw3 -lfftw3f -lblas -llapack -lltfat-nomem

mex-memalloc.o:	mex-memalloc.c
	mex $(CFLAGS) $<

clean:
	rm *.$(EXT)

.PHONY: all clean
