* Paul Dreik <sl...@pauldreik.se> [2012-06-24 11:44]:

> However, I am glad to simplify the existing solution while at the same
> time avoiding dependencies on awk or gsed. Is "word" GNU make specific?
> I did not see any note about it in the manual, but I did not check
> thoroughly.
> In the meanwhile, I have changed to the  $(word 5... solution. It should
> handle version strings like 3.7.11+ properly, as someone had problem
> with earlier.

Here is another solution that depends only on the availability of
Octave itself:

majorversion := $(shell echo 'printf (strsplit (OCTAVE_VERSION, ".") (1) {1})' 
| octave -q)
minorversion := $(shell echo 'printf (strsplit (OCTAVE_VERSION, ".") (2) {1})' 
| octave -q)
microversion := $(shell echo 'printf (strsplit (OCTAVE_VERSION, ".") (3) {1})' 
| octave -q)

Rafael

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to