help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subst question


From: Brendan Heading
Subject: Re: subst question
Date: Fri, 26 Jan 2007 15:41:58 +0000

John Graham-Cumming writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Brendan Heading wrote:
Another quick question. Does anyone know a way in GNU Make to filter off
the first instance only of a given string.
For example, at the moment I'm doing
$(subst lib,,libfoo.a)
which gives me "foo.a". However if I do :
$(subst lib,,libbarlib.a)
this also gives me "bar.a" even though what I need is "barlib.a".

Use patsubst: $(patsubst lib%,%,libbarlib.a) will give the result you
are looking for.

Thanks everyone, that did exactly what I needed. Regards Brendan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]