delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/22/04:39:46

Date: Thu, 22 Jun 2000 11:38:52 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
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: <Pine.SUN.3.91.1000622113819.24311D-100000@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019