[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: subst question
From: |
John Graham-Cumming |
Subject: |
Re: subst question |
Date: |
Fri, 26 Jan 2007 15:53:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104 |
-----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.
John.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFuhYDLphrp73n/hARAixtAJ4/AJ3wLNzwP/t/xyHHraW+npKrbACgmW77
pAzeXnU4Rzcz87WGcx150a4=
=uIO5
-----END PGP SIGNATURE-----