help-make
[Top][All Lists]
Advanced

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

Re: Problems with eval


From: Paul D. Smith
Subject: Re: Problems with eval
Date: Wed, 29 Sep 2004 12:32:36 -0400

%% Greg Kilfoyle <address@hidden> writes:

  gk> (not sure if libraries are allowed to be dependent on each other
  gk> and whether make handles it, but I'm assuming it is allowed and
  gk> that make does handle it).

Make doesn't know from libraries.  Any target can depend on anything, as
long as it doesn't create a loop in the dependency graph.

  gk> Z: $(objs) $(libs)
  gk>         $(CC) $($(eval $(prg_dep_Z)):%=-l%) ...

This can't work, in many ways.  You can only use the $(VAR:...)
construct on variable names; the only way this would work is if the eval
returned the name of a single variable.

You'd have to use the patsubst function here.

I'm not even sure why you need the eval here at all.

  gk> ...this is simplified for the example. This didn't work. I placed some
  gk> warning commands in the top level make file to see what was going on:

  gk> $(warning $(prg_dep_Z))         # this produced: $(lib_dep_A)
  gk> $(lib_dep_B)
  gk> $(warning $(lib_dep_A))         # this produced: $(lib_dep_B) A
  gk> $(warning $(eval $(prg_dep_Z))) # this produced nothing

I got a little lost trying to follow the evolution of your makefile.

Can you please provide a single simple, portable makefile that displays
the problem behavior, show the output you think is incorrect, show what
you think it should be instead?

Then we can look at it.


Also there are a few fixes to eval bugs on the Savannah site,
www.savannah.org.  Look specifically at bug #'s 1516, 1517, and maybe
2238.

Thanks!

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