Date: Thu, 22 Jun 2000 11:38:52 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Richard Dawe cc: djgpp AT delorie DOT com Subject: Re: Inline asm: lcall & various binutils versions In-Reply-To: <395095E9.F94D70EC@phekda.freeserve.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 21 Jun 2000, Richard Dawe wrote: > > > GAS_VERSION := $(shell as --version | sed -n 's/^GNU assembler //p') > > > GAS_MAJOR := $(shell echo $(GAS_VERSION) \ > > > | sed -n 's/^\([0-9]*\).*/\1/p') > > > GAS_MINOR := $(shell echo $(GAS_VERSION) \ > > > | sed -n 's/^[0-9]*\.\([0-9]*\).*/\1/p') > > > GAS_MINORMINOR := $(shell echo $(GAS_VERSION) \ > > > | sed -n 's/^[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/p') > > > > Is this satisfactory? My sed knowledge is limited (*), but this seems > > > to do the trick. > > > > The Sed scripts can be improved slightly, but they seem to be correct. > > Sure, please tell me how, when you have time. The last script could be simplified like this: GAS_MINORMINOR := $(shell echo $(GAS_VERSION) \ | sed -n 's/.*\.\([0-9][0-9]*\)$/\1/p') Also note that [0-9]* can pick up zero characters, so [0-9][0-9]* is safer.