I was recently needing to see examine the variable MAKEFILE_LIST as it was being built up.
The default way of printing it - with "v" - makes it a little hard to follow exactly what it contains, since it's just a space separated list.
I felt it would be easier to view it as a newline separated list, so I changed the __DEBUG command to that below. I, at least, like the option this provides. (Hmmm - note that since this uses the info function it's not so compatible with older make implementations!)
Regards,
John Orr
__DEBUG = $(eval __c = $(strip $1)) \
$(eval __a = $(strip $2)) \
$(if $(call seq,$(__c),c), \
$(true), \
$(if $(call seq,$(__c),q), \
$(error Debugger terminated build), \
$(if $(call seq,$(__c),v), \
$(warning $(__a) has value '$($(__a))'), \
$(if $(call seq,$(__c),V), \
$(warning $(__a) has newline-separated value:) \
$(foreach w,$($(__a)),$(info $w)), \
$(if $(call seq,$(__c),d), \
$(warning $(__a) is defined as '$(value $(__a))'), \
$(if $(call seq,$(__c),o), \
$(warning $(__a) came from $(origin $(__a))), \
$(if $(call seq,$(__c),b), \
$(call __BP_SET,$(__a)), \
$(if $(call seq,$(__c),r), \
$(call __BP_UNSET,$(__a)), \
$(if $(call seq,$(__c),l), \
$(call __BP_LIST), \
$(if $(call seq,$(__c),h), \
$(warning c: continue) \
$(warning q: quit) \
$(warning v VAR: print value of $$(VAR)) \
$(warning V VAR: print newline-separated value of $$(VAR)) \
$(warning o VAR: print origin of $$(VAR)) \
$(warning d VAR: print definition of $$(VAR)) \
$(warning b TAR: set a breakpoint on target TAR) \
$(warning r TAR: unset breakpoint on target TAR) \
$(warning l: list all target breakpoints), \
$(warning Unknown command '$(__c)')))))))))))