diff extra/NaN/src/Makefile @ 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 b0e00812d4ee
children 664b99514b4a
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))