PATTON, BILLY (SBCSI) wrote:
This works fine for proj alias PROJECTS
Now looking at each of the PROJECTS I need to create the same thing
$(foreach var for each of the
BB_<proj> But I don't want to hard code all the names. This needs to
be expandable in the future
This will then be further created for the TOPIC_<proj>_<bb>
My first best try
$foreach proj,${PROJECTS},
Will give me the list names
$(addprefix BB_,${PROJECTS})
So would it be something like
$(foreach proj,${PROJECTS} # to capture project name
, $(foreach bb, $(addprefix BB_,${proj})) # name of list BB_<proj>
, $(eval $(call dummy_template, ${bb})) # call define
) # foreach
What you want to do is calculate the name of a variable and then get its
value. That's trivial in GNU Make. For example, take a look at this:
X := Y
YY := Hello!
all:
@echo $($X$X)
This will print Hello! because $($X$X) will first be expanded to $(YY)
because X = Y and then $(YY) will be expanded to Hello! So in your
example what you want to do is this:
$(foreac proj,$(PROJECTS),$(foreach bb,$(BB_$(proj)), $(eval $(call
dummy_template,$(bb)))))
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make