view src/of-tsa-1-cross-fixes.patch @ 4066:0962acdde3be

builld: allow out of source build * Makefile.in: add TOP_BUILD_DIR var and use TOP_DIR=srcdir, TOP_BUILD_DIR=builddir, modify paths to use TOP_DIR where needed * binary-dist-rules.mk: use TOP_DIR and TOP_BUILD_DIR where needed * makeinst-script.sh: use script path to determine TOPDIR, use TOPDIR where needed * src/default-octave.mk: install octave-version to builddir * src/stable-octave.mk: install octave-version to builddir * src/octave.mk: install octave-version to builddir * tools/set-mxe-env.sh.in: update fir builddir and srcdir use
author John Donoghue
date Wed, 23 Dec 2015 08:11:04 -0500
parents c970bbc5e7db
children
line wrap: on
line source

diff -ur tsa.orig/src/Makefile tsa/src/Makefile
--- tsa.orig/src/Makefile	2015-09-16 09:30:29.103875849 -0400
+++ tsa/src/Makefile	2015-09-16 09:40:42.945344571 -0400
@@ -41,9 +41,16 @@
 
 CC  	?= gcc
 CXX 	?= g++
-CFLAGS 	= -Wall -Wextra -Wconversion -O2 -fPIC 
-OCTMEX	= mkoctfile$(OCTAVE_VERSION) --mex -lgomp
-RM      = rm
+CFLAGS 	?= -Wall -Wextra -Wconversion -O2 -fPIC 
+MKOCTFILE ?= mkoctfile$(OCTAVE_VERSION)
+OCTAVE_CONFIG ?= octave-config
+CANONICAL_HOST_TYPE=$(shell $(OCTAVE_CONFIG) -p CANONICAL_HOST_TYPE)
+ifneq (,$(findstring mingw,$(CANONICAL_HOST_TYPE)))
+  OCTMEX	?= $(MKOCTFILE) --mex
+else
+  OCTMEX	?= $(MKOCTFILE) --mex -lgomp
+endif
+RM      ?= rm
 
 ifneq (Darwin,$(shell uname))
 CFLAGS      += -fopenmp
@@ -89,7 +96,7 @@
 #	Octave, MATLAB on Linux 
 #########################################################
 %.oct: %.cc
-	mkoctfile$(OCTAVE_VERSION) "$<"
+	$(MKOCTFILE) "$<"
 
 %.mex: %.cpp
 	$(OCTMEX) "$<" -llapack -lblas