On 6/29/07, Stephan Beal <[EMAIL PROTECTED]> wrote:
...
i've got it working, but of course it's missing the short-circuit
features of built-ins, e.g. so that the $(error) in:
$(if X,,$(error this is an error))
will only be evaluated if !X. That works for built-ins of course, but i
don't see a way to do it with add-on funcs.

It can't be done.  To quote the info pages:
  The `call' function expands the PARAM arguments before assigning
  them to temporary variables.


The closest alternative I can think of is to instead pass the names of
variables to be evaluated for the 'then' and 'else' clauses:

mythen = $(warning this should happen)
myelse = $(warning this should not happen)
$(call if-eq-vars,abc,abc,mythen,myelse)


That's not hard to implement:

if-eq-vars = $(eval ${if-eq-vars-impl})
define if-eq-vars-impl
ifeq ($1,$2)
$(value $3)
else
$(value $4)
endif
endef


...but it's clunky to use, eliminating most the point of the function.


Philip Guenther


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to