help-make
[Top][All Lists]
Advanced

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

Re: quoting $$ (or something completely different?)


From: Tom Bachmann
Subject: Re: quoting $$ (or something completely different?)
Date: Sat, 01 Apr 2006 08:41:05 +0200
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051031)

Paul D. Smith wrote:
%% Tom Bachmann <address@hidden> writes:

tb> I'm trying to transform $(NAME)_CFLAGS := $$(CFLAGS) into $(eval $(call tb> SET,CFLAGS)), but I don't get it right.

  tb> define SET
  tb> $$(NAME)_$(1) := $$$$($(1))
  tb> endef

  tb> seems not to work. If I "hardcode" the sequence, everything works fine.

  tb> To give you some context:
tb> a main makefile does $(eval $(call FOOFN,foo)) and this FOOFN does tb> $(eval $(call SET,CFLAGS)).

Sorry, but this description is not sufficient for us to determine your
problem.

I thought it was, because the initial sequence worked just fine.

Please write a complete, but simple, makefile that
demonstrates your problem and show how you invoked it and what the
result was, and why that was wrong.  Just saying it's not right doesn't
mean anything to us.


I cannot provide much more information: CFLAGS seems not to be set at all.

See http://www.catb.org/~esr/faqs/smart-questions.html.


The information you provide above is not complete: you say you call this
in your makefile:

  $(eval $(call FOOFN,foo))

then you say that FOOFN does this:

  $(eval $(call SET,CFLAGS))

where SET is this:

  define SET
  $$(NAME)_$(1) := $$$$($(1))
  endef

There has to be more than this, because here $(NAME) has no value.

It is defined as

NAME = $(subst /,_,$(1))

so yes, here NAME is supposed to be foo.

I
can only assume from your description that you intend $(NAME) to have
the value "foo" (the argument you use when you call FOOFN), but that
transition is not shown here, and is certainly critical to the behavior.


In the attached makefile, foo_bar_CFLAGS is set to `$(CFLAGS)', if I use 3 `$' for quoting in SET, foo_bar_CFLAGS is not set at all.
--
-ness-


NAME = $(subst /,_,$(1))

define SET
$$(NAME)_$(1) := $$$$($(1))
endef

define FOO
CFLAGS := foo bar baz foo2
$(eval $(call SET,CFLAGS))
endef

$(eval $(call FOO,foo/bar))

all:
        @echo '$(foo_bar_CFLAGS)'

reply via email to

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