changeset 12572:22658fcb51e9 octave-forge

[tsa][nan] fix handling of MATLABDIR variable in Makefile
author schloegl
date Mon, 30 Mar 2015 19:47:23 +0000
parents 7a64d4df2987
children 5d4cdc6e7bec
files extra/NaN/src/Makefile extra/tsa/src/Makefile
diffstat 2 files changed, 10 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/extra/NaN/src/Makefile	Fri Mar 27 12:12:34 2015 +0000
+++ b/extra/NaN/src/Makefile	Mon Mar 30 19:47:23 2015 +0000
@@ -52,17 +52,16 @@
 
 
 ### Matlab configuration - search for a matlab directory if not defined above
-ifndef MATLABDIR
+ifeq (,$(MATLABDIR))
   ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB))
-    # use oldest, typically mex-files a compatible with newer Matlab versions 
-    MATLABDIR=/usr/local/MATLAB/$(shell ls -1t /usr/local/MATLAB/  |grep "^R*" |head -1)
-    # alternatively, use latest matlab version
-    #MATLABDIR=$(shell ls -dt1 /usr/local/MATLAB/R* |head -1)
+    # use oldest, typically mex-files are compatible with newer Matlab versions 
+    MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/  |grep "^R20*" |head -1)
   endif
 endif
 
-### if the MATLABDIR has been found or defined 
-ifneq (,MATLABDIR)
+
+### if MATLABDIR has been found or defined 
+ifneq (,$(MATLABDIR))
   ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext))
     MEX_EXT=$(shell $(MATLABDIR)/bin/mexext)
     mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS))
--- a/extra/tsa/src/Makefile	Fri Mar 27 12:12:34 2015 +0000
+++ b/extra/tsa/src/Makefile	Mon Mar 30 19:47:23 2015 +0000
@@ -60,17 +60,15 @@
 
 
 ### Matlab configuration - search for a matlab directory if not defined above
-ifndef MATLABDIR
+ifeq (,$(MATLABDIR))
   ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB))
     # use oldest, typically mex-files a compatible with newer Matlab versions 
-    MATLABDIR=/usr/local/MATLAB/$(shell ls -1t /usr/local/MATLAB/  |grep "^R*" |head -1)
-    # alternatively, use latest matlab version
-    #MATLABDIR=$(shell ls -dt1 /usr/local/MATLAB/R* |head -1)
+    MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/  |grep "^R*" |head -1)
   endif
 endif
 
-### if the MATLABDIR has been found or defined 
-ifneq (,MATLABDIR)
+### if MATLABDIR has been found or defined 
+ifneq (,$(MATLABDIR))
   ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext))
     MEX_EXT=$(shell $(MATLABDIR)/bin/mexext)
     mex4m matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS))