Subject: Re: Regexp with "exists" expression? (BSD make)
To: Julio M. Merino Vidal <jmmv@menta.net>
From: Alistair Crooks <agc@pkgsrc.org>
List: tech-pkg
Date: 06/21/2004 08:48:41
On Mon, Jun 21, 2004 at 09:03:27AM +0200, Julio M. Merino Vidal wrote:
> On Mon, 21 Jun 2004 00:48:27 +0200
> Juan RP <juan@netbsd.graffitipr.org> wrote:
> 
> > 
> > Hi,
> > 
> > There is a problem with OpenBSD and mk/pthread.buildlink3.mk, the
> > pthread library is just installed as "libpthread.so.X.X" but there are not
> > "foo.so" or "foo.so.X", and BUILDLINK_LDADD.pthread is empty...
> > 
> > I would like to use a regexp with the "exists" option in BSD make, like:
> > 
> > .if exists(/foo.*)
> > 	<blah>
> > .endif
> > 
> > Is it possible? is there any other way to solve this problem?
> 
> I guess something like...
> 
> _FILES!= ${LS} -d /some/directory/foo.*

I'd just add an "|| ${TRUE}" onto the end of this so that the shell
command exits with a successful error code, otherwise there will be
warnings every time the shell command is evaluated and the file does
not exist (you'd probably be surprised how many times the evaluation
takes place).

You'd also better make it a shell glob expression, rather than a
regexp, BTW.

Regards,
Alistair