[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Filtering ${.VARIABLES} ?
From: |
Frazer Worley |
Subject: |
Filtering ${.VARIABLES} ? |
Date: |
Fri, 22 Jun 2007 07:37:34 -0400 |
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.
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.
So I'd like to filter out all macros and just report the variables. I've tried using a $(filter ...) based
on the variable name - macros are always lowercase named - but the filter doesn't seem to support
regexps. .... so that doesn't work.
Any tips much appreciated.
Thanks,
-Frazer
- Filtering ${.VARIABLES} ?,
Frazer Worley <=