On 6/22/07, Frazer Worley <[EMAIL PROTECTED]> wrote:
I want a target which just dumps the variables defined in my Makefile. So I
wrote this - using ${.VARIABLES} and filtering using origin.


VERBOSITY=                BRIEF
 PROJECT_TAG=              btc

 define dump_variable
 endef

 dumpvars:
   $(foreach i,${.VARIABLES},\
     $(if $(filter file,$(origin $i)),\
       $(info $i),\
     )\
   )

Problem is though - that it reports "dump_variable" also ... which is a user
defined macro rather than a simple variable.

Could you clarify your terminology?  The info pages use "simple
variable" to refer to variables set with ":=", but that doesn't appear
to be how you're using it.  Similarly, "macro" is just a synonym for
"variable", so I don't understand your distinction between "user
defined macro" and "simple variable".


 This becomes an issue when I extend dumpvars to report the value of the
variables its reporting, I get Make errors when dumpvars issues
$(info $i = $($i)) on some of my macros.

That's probably because the variables contain further variable or
function expansions.  Try $(info $i = $(value $i))


Philip Guenther


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

Reply via email to