I have partially answered my question:
if I substitute '$$(a)' for '$(a)' I get the result I expected.

I think my problem was in understanding how $(call ...) works.
It seems that 'call' does not do any evaluation or variable assignment; only expansion.
When 'call' sees:
a-copy:=$(a)
'$(a)' and '$(1)' are expanded:
$(1) -> hello
$(a) ->
Then finally 'eval' makes the assignments:
a:=hello
a-copy:=
etc.

At 06:48 PM 11/25/2002 -0800, gk wrote:
Can anyone explain how to assign the value of $(a) in the following makefile?
This is a simplified version of what I am trying to do: I need to perform filtering on the input $(1) so I cannot simply substitue $(1) for $(a) in the following example.

# makefile
define macro

a:=$(1)
a-copy:=$(a)
a-reference=$(a)
$(eval a-copy-eval:=$(a))
$(eval a-reference-eval=$(a))

foo:
@echo 'a=$$(a)'
@echo 'a-copy=$$(a-copy)'
@echo 'a-reference=$$(a-reference)'
@echo 'a-copy-eval=$$(a-copy-eval)'
@echo 'a-reference-eval=$$(a-reference-eval)'
endef # XMake_outfileRule

$(eval $(call macro,hello))
# eof

- Greg Keraunen



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make
- Greg Keraunen


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to