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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to