[ba1662]: mex / Makefile_unix Maximize Restore History

Download this file

Makefile_unix    40 lines (27 with data), 1.1 kB

# To run this makefile, you must provide the EXT and MATLABROOT
# variables on the command line, i.e. as in
#
# make -f Makefile_unix MATLABROOT=/usr/local/MATLAB/R2011a  EXT=$(mexext)

ifndef MATLABROOT
  $(warning MATLABROOT variable is udefined. Using default MATLABROOT="/usr/local/MATLAB/R2011a/")
  MATLABROOT=/usr/local/MATLAB/R2011a/
endif

ifndef EXT
  $(warning EXT variable is udefined. Using default EXT=mexa64)
  EXT=mexa64
endif

ifndef ARCH
  $(warning ARCH variable is udefined. Using default ARCH=maci64 )
  ARCH=maci64
endif


CFLAGS=-shared -O3 -Wall -s -std=c99 -I../src/thirdparty -I../src -I$(MATLABROOT)/extern/include -L../lib -L/opt/local/lib/

include filedefs.mk

MEXBASE = $(MEXBASESAFE) $(MEXBASEMORE) 
MEXS     = $(addsuffix .$(EXT),$(MEXBASE))

MEXLINKFLAGS=-L"$(MATLABROOT)/bin/$(ARCH)" -lmex -lmx

all: $(MEXS)

%.$(EXT): %.c Makefile config.h ../lib/libltfat.a ../src/ltfat.h
	$(CC) $(CFLAGS) $(MEXCOMPFLAGS) $< -o $@ -fPIC -lltfat -lltfatf -lfftw3 -lfftw3f -lblas -llapack $(MEXLINKFLAGS)

clean:
	-rm *.$(EXT)

.PHONY: all clean