[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: debugging eval,call,foreach....
From: |
Toomas Rosin |
Subject: |
Re: debugging eval,call,foreach.... |
Date: |
Mon, 21 Oct 2002 15:58:59 +0300 (EEST) |
Hello!
I wrote:
Use `warning'.
Better yet, use a function that both displays the expression to be
evalled and really does the evaluation. Using this method, I finally
got the damn thing working.
So, I would say that eval is quite debuggable.
Example (note the "verbose-eval" function):
subjects = dog hen man
dog-legs = 4
dog-wears = hair
hen-legs = 2
man-legs = 2
man-wears = clothes
verbose-eval = $(warning $1) $(eval $1)
define defaults
$(if $$(filter 2,$($1-legs)),$1-wears ?= feathers)
endef
$(foreach s,$(subjects),$(call verbose-eval,$(call defaults,$s)))
all:
@($(foreach s,$(subjects),echo $s: $($s-wears);))
Transcript:
address@hidden:~ $ make
Makefile:18:
dog-wears ?= feathers
Makefile:18:
hen-wears ?= feathers
Makefile:18:
man-wears ?= feathers
dog: hair
hen: feathers
man: clothes
address@hidden:~ $
Of course, the output is not very interesting any more now that all is
working well, but it was helpful for finding mistakes.
Toomas.
- GNU make 3.80 is now available, psmith, 2002/10/04
- debugging eval,call,foreach...., mcmahill, 2002/10/15
- Re: debugging eval,call,foreach...., Paul D. Smith, 2002/10/15
- Re: debugging eval,call,foreach...., Russell, 2002/10/16
- Re: debugging eval,call,foreach...., Toomas Rosin, 2002/10/21
- Re: debugging eval,call,foreach....,
Toomas Rosin <=