From: <pau...@us...> - 2012-06-24 21:40:21
|
Revision: 10685 http://octave.svn.sourceforge.net/octave/?rev=10685&view=rev Author: pauldreik Date: 2012-06-24 21:40:15 +0000 (Sun, 24 Jun 2012) Log Message: ----------- "* version macros check have been simplified, using word splitting functionality from make instead of using sed. Code from Stephen Montgomery-Smith * now uses MKOCTFILE variable instead of mkoctfile directly. Thank you Mike Miller for the reminder! Modified Paths: -------------- trunk/octave-forge/main/sockets/src/Makefile Modified: trunk/octave-forge/main/sockets/src/Makefile =================================================================== --- trunk/octave-forge/main/sockets/src/Makefile 2012-06-24 19:38:31 UTC (rev 10684) +++ trunk/octave-forge/main/sockets/src/Makefile 2012-06-24 21:40:15 UTC (rev 10685) @@ -1,11 +1,22 @@ OCT = sockets.oct SRC := $(OCT:.oct=.cc) +#Allow mkoctfile to be set externally. +MKOCTFILE ?= mkoctfile +OCTAVE ?= octave + #See which octave version we run by querying mkoctfile for its version -#string. (Is there a better way to do this? This looks horrible.) -majorversion := $(shell mkoctfile --version 2>&1 | sed -e 's/[ .+]/\n/g' |sed -n '3p') -minorversion := $(shell mkoctfile --version 2>&1 | sed -e 's/[ .+]/\n/g' |sed -n '4p') -microversion := $(shell mkoctfile --version 2>&1 | sed -e 's/[ .+]/\n/g' |sed -n '5p') +#string. This is needed because there was an octave macro that changed +#from 3.0 to 3.2. When 3.0 is considered long gone, this is not +#needed anymore. +#The best thing would be to do this check inside the .cc file, but I +#believe there are no version macros other than VERSION from +#octave/config.h, which is a string and difficult to deal with. The octave +#developers discourage from relying on versions, so this is not likely +#to be supported. +majorversion := $(word 3,$(shell $(MKOCTFILE) --version 2>&1 | sed 's/\./ /g')) +minorversion := $(word 4,$(shell $(MKOCTFILE) --version 2>&1 | sed 's/\./ /g')) +microversion := $(word 5,$(shell $(MKOCTFILE) --version 2>&1 | sed 's/\./ /g')) VFLAGS=-DMAJORVERSION=$(majorversion) VFLAGS+=-DMINORVERSION=$(minorversion) @@ -14,10 +25,10 @@ all: $(OCT) %.oct: %.cc - mkoctfile $(VFLAGS) -s $< + $(MKOCTFILE) $(VFLAGS) -s $< test: $(OCT) - test_octave_sockets + $(OCTAVE) -q ./test_octave_sockets clean: rm -f *.oct *.o This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |