18 | | MEX_OPTION += -largeArrayDims |
19 | | |
20 | | # Mingw crosscompiler: available at http://www.nongnu.org/mingw-cross-env/ |
21 | | CROSS = $(HOME)/src/mxe/usr/bin/i686-w64-mingw32.static |
22 | | CROSS64 = $(HOME)/src/mxe/usr/bin/x86_64-w64-mingw32.static |
23 | | # include directory for Win32-Matlab include |
24 | | W32MAT_INC = -I$(HOME)/bin/win32/Matlab/R2010b/extern/include/ |
25 | | W64MAT_INC = -I$(HOME)/bin/win64/Matlab/R2010b/extern/include/ |
26 | | # path to GNUMEX libraries, available from here http://sourceforge.net/projects/gnumex/ |
27 | | GNUMEX = $(HOME)/bin/win32/gnumex |
28 | | GNUMEX64 = $(HOME)/bin/win64/gnumex |
29 | | # building gnumex64 was difficult, these hints were quite useful: |
30 | | # http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinZvxgC9ezp2P3UCX_a7TAUYuVsp2U40MQUV6qr%40mail.gmail.com&forum_name=gnumex-users |
31 | | # Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin; |
32 | | #################################################### |
33 | | W32MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS))/include/ |
34 | | W64MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS64))/include/ |
35 | | LDLIBS_W32 = $(subst /usr/bin/,/usr/,$(CROSS))/lib/ |
36 | | LDLIBS_W64 = $(subst /usr/bin/,/usr/,$(CROSS64))/lib/ |
37 | | W32_LIBS = $(LDLIBS_W32)liblapack.a |
38 | | W64_LIBS = $(LDLIBS_W64)liblapack.a |
39 | | W32_LIBS += $(LDLIBS_W32)libblas.a |
40 | | W64_LIBS += $(LDLIBS_W64)libblas.a |
41 | | |
42 | | CC ?= gcc |
43 | | CXX ?= g++ |
| 18 | # MEX_OPTION += -largeArrayDims |
| 19 | # |
| 20 | # # Mingw crosscompiler: available at http://www.nongnu.org/mingw-cross-env/ |
| 21 | # CROSS = $(HOME)/src/mxe/usr/bin/i686-w64-mingw32.static |
| 22 | # CROSS64 = $(HOME)/src/mxe/usr/bin/x86_64-w64-mingw32.static |
| 23 | # # include directory for Win32-Matlab include |
| 24 | # W32MAT_INC = -I$(HOME)/bin/win32/Matlab/R2010b/extern/include/ |
| 25 | # W64MAT_INC = -I$(HOME)/bin/win64/Matlab/R2010b/extern/include/ |
| 26 | # # path to GNUMEX libraries, available from here http://sourceforge.net/projects/gnumex/ |
| 27 | # GNUMEX = $(HOME)/bin/win32/gnumex |
| 28 | # GNUMEX64 = $(HOME)/bin/win64/gnumex |
| 29 | # # building gnumex64 was difficult, these hints were quite useful: |
| 30 | # # http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinZvxgC9ezp2P3UCX_a7TAUYuVsp2U40MQUV6qr%40mail.gmail.com&forum_name=gnumex-users |
| 31 | # # Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin; |
| 32 | # #################################################### |
| 33 | # W32MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS))/include/ |
| 34 | # W64MAT_INC += -I$(subst /usr/bin/,/usr/,$(CROSS64))/include/ |
| 35 | # LDLIBS_W32 = $(subst /usr/bin/,/usr/,$(CROSS))/lib/ |
| 36 | # LDLIBS_W64 = $(subst /usr/bin/,/usr/,$(CROSS64))/lib/ |
| 37 | # W32_LIBS = $(LDLIBS_W32)liblapack.a |
| 38 | # W64_LIBS = $(LDLIBS_W64)liblapack.a |
| 39 | # W32_LIBS += $(LDLIBS_W32)libblas.a |
| 40 | # W64_LIBS += $(LDLIBS_W64)libblas.a |
| 41 | # |
| 42 | # CC ?= gcc |
| 43 | # CXX ?= g++ |
67 | | ifeq (,$(MATLABDIR)) |
68 | | ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB)) |
69 | | # use oldest, typically mex-files a compatible with newer Matlab versions |
70 | | MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/ |grep "^R*" |head -1) |
71 | | endif |
72 | | endif |
73 | | |
74 | | ### if MATLABDIR has been found or defined |
75 | | ifneq (,$(MATLABDIR)) |
76 | | ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext)) |
77 | | MEX_EXT=$(shell $(MATLABDIR)/bin/mexext) |
78 | | mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS)) |
79 | | endif |
80 | | endif |
81 | | |
82 | | |
83 | | mexw32 win32: $(patsubst %.mex, %.mexw32, $(PROGS)) |
84 | | mexw64 win64: $(patsubst %.mex, %.mexw64, $(PROGS)) |
85 | | all: octave win32 win64 mex4m |
| 67 | # ifeq (,$(MATLABDIR)) |
| 68 | # ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB)) |
| 69 | # # use oldest, typically mex-files a compatible with newer Matlab versions |
| 70 | # MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/ |grep "^R*" |head -1) |
| 71 | # endif |
| 72 | # endif |
| 73 | # |
| 74 | # ### if MATLABDIR has been found or defined |
| 75 | # ifneq (,$(MATLABDIR)) |
| 76 | # ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext)) |
| 77 | # MEX_EXT=$(shell $(MATLABDIR)/bin/mexext) |
| 78 | # mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS)) |
| 79 | # endif |
| 80 | # endif |
| 81 | # |
| 82 | # |
| 83 | # mexw32 win32: $(patsubst %.mex, %.mexw32, $(PROGS)) |
| 84 | # mexw64 win64: $(patsubst %.mex, %.mexw64, $(PROGS)) |
| 85 | all: octave |