On Thu, 2011-04-21 at 01:16 +0200, Ralf Wildenhues wrote:
> Hello Justin,
> 
> * Too, Justin A. wrote on Wed, Apr 20, 2011 at 11:33:26PM CEST:
> > FOO=1 2
> > $(FOO:=bar) => 1bar 2bar.
> > 
> > Is there a way to prepend bar?
> 
> This is a GNU make question, or maybe a Posix make question, depending
> on what you target.  In Posix make, the answer is no.  With GNU make,
> you can use the patsubst function, see 'info make --index patsubst'.

If you have GNU make you can just write:

        $(FOO:%=bar%)

which is shorter/simpler than using patsubst.


Cheers!

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psm...@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


Reply via email to