help-make
[Top][All Lists]
Advanced

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

Re: Making rules print $


From: David A. Greene
Subject: Re: Making rules print $
Date: Tue, 14 Aug 2007 22:59:09 -0500
User-agent: KMail/1.9.5

On Tuesday 14 August 2007 22:53, David Boyce wrote:
> David A. Greene wrote:
> > How do I echo a raw $ character in a make rule?
>
> % cat makefile
> all: ; @echo '$$'
> % make
> $
> %

Heh.

Ok, I confess, I wasn't complete.

Here's something closer to what I have to do (the actual
code is much more complicated):

define some_func

target: $$($(1))
        echo '$$' > $$@
endef

my_func = $(eval $(call some_func,$(1)))

The $$' gets evaluated by the eval and thus disappears, causing a shell parse
error:

cd make -f test.mk target
Done!
echo ' > target
/bin/sh: -c: line 0: unexpected EOF while looking for matching `''
/bin/sh: -c: line 1: syntax error: unexpected end of file
make: *** [target] Error 2

Is there a way to protect the evaluation of $ in a define section?

                                           -Dave




reply via email to

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