help-make
[Top][All Lists]
Advanced

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

Re: bug in gnumake?? Using eval with wildcard function


From: Paul D. Smith
Subject: Re: bug in gnumake?? Using eval with wildcard function
Date: Fri, 10 Oct 2003 16:47:32 -0400

%% address@hidden writes:

  hpvl> tmp = $(wildcard cmd/*.tcl) 

  hpvl> DEP_CMD=$(foreach OBJ, % ,$(addprefix %, $(tmp))) 

  hpvl> The wildcard failes because it is only filled in once for the first %
  hpvl> only. 

None of the above is evaluated yet.  When it is, it will evaluate to:

  $(addprefix %, $(tmp))

Because your loop only executes once (you have only element, "%", in the
list of elements to be looped over), and you never actually use the loop
variable OBJ anywhere.  So, the foreach is a complete no-op in this
situation.

The addprefix will evaluate to:

  %$(wildcard cmd/*.tcl)

which, if you have foo.tcl, bar.tcl, and baz.tcl in your cmd directory
will result in:

  %cmd/foo.tcl bar.tcl baz.tcl

I assume that's not what you want.  I really don't have the faintest
idea what you're _TRYING_ to do, so I can't even begin to help.

Whatever you're trying to do, what you're doing above is _NOT_ going to
get you there.

-- 
-------------------------------------------------------------------------------
 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]