Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[164e09]: mex / Makefile_mingw Maximize Restore History

Download this file

Makefile_mingw    42 lines (30 with data), 1.1 kB

# To run this makefile, you must provide your system specific EXT and MATLABROOT
# variables on the command line e.g.:
#
# make -f Makefile_mingw64 MATLABROOT="C:\Program Files\MATLAB\R2011b"  EXT=mexw64 ARCH=win64

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

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

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

CC=gcc
CFLAGS=-shared -O3 -Wall -s -std=c99 -I../src/thirdparty -I../src

include filedefs.mk

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

MEXCOMPFLAGS=-I"$(MATLABROOT)\extern\include" -DMATLAB_MEX_FILE
MEXLIBS=-lmex -lmx
MEXLINKFLAGS=-static-libgcc -L"$(MATLABROOT)\bin\$(ARCH)" $(MEXLIBS)

all: $(MEXS)

%.$(EXT): %.c 
	$(CC) $(CFLAGS) $(MEXCOMPFLAGS) $< -o $@ -L../lib -lltfat -lltfatf -L./ -lfftw3-3 -lfftw3f-3 $(MEXLINKFLAGS)

clean:
	del *.$(EXT)

.PHONY: all clean