help-make
[Top][All Lists]
Advanced

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

Re: problerm using eval


From: Paul D. Smith
Subject: Re: problerm using eval
Date: Tue, 25 Nov 2003 10:16:30 -0500

%% address@hidden writes:

  hpvl> Any hints for my earlier posted question as put below?  I tried
  hpvl> to rewrite my make script with an eval statement to prevent
  hpvl> include commands since our environment prefers not to have
  hpvl> additional files.  But somehow the extra rule is not included
  hpvl> now.

  hpvl> Below my trial, what could be wrong? I like to learn from this. 

  hpvl> MODULES = Mod1 Mod2..... 
  hpvl> MOD_PATH = $(foreach OBJ,$(MODULES),../../$(OBJ)/synopsys) 
  hpvl> define ADD_rules 
  hpvl>       $(1)/ddb/generic.db : $(1)/$(wildcard /cmd/*specific.tcl ) 
  hpvl> endef 

I'm confused here.  Why do you have just '/cmd/*...', when in the
original one you used '$$t/cmd/...'?

  hpvl> $(foreach mod,$(MOD_PATH),$(eval $(call ADD_rules,$(mod)) ) )

Your problem is almost certainly some sort of expansion issue.  It takes
a bit of working with $(eval ...) before you get used to the expansion
rules that are used, and understand when you have to escape things and
when you don't.

I recommend using $(warning ...) as a debugging tool.  Replace the call
to eval with a call to warning and you'll see exactly what is being
evaluated.  That can help you understand what is going on:

    $(foreach mod,$(MOD_PATH),$(warning $(call ADD_rules,$(mod))))

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "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]