help-make
[Top][All Lists]
Advanced

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

Re: Executing Perl pattern substitution inside a Makefile


From: Frazer Worley
Subject: Re: Executing Perl pattern substitution inside a Makefile
Date: Tue, 18 Dec 2007 12:29:55 -0500


Thanks - got that working:

  ${QUIET} ${CAT} ${VERA_LIBRARY_DEPS} | perl -ple 's/\$$\{(\w+)\}/$$ENV{$$1}/g' >> $@

Appreciate the help.

-Frazer


On Dec 18, 2007 12:25 AM, Paul Smith < address@hidden> wrote:
On Mon, 2007-12-17 at 18:00 -0500, Frazer Worley wrote:
> perl -ple 's/\$\{(\w+)\}/$ENV{$1}/g'

Check the GNU make manual.  Any dollar sign ($) in a recipe is
interpreted as a make variable reference and expanded before the recipe
is passed to the shell.

In order to escape dollar signs, you need to double them ($$).  So, use
this instead:

       perl -ple 's/\$$\{(\w+)\}/$$ENV{$$1}/g'

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


reply via email to

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