Yes, my logic is wrong but it is where I need to start. There are 7 flows that I need to attach to _<proj> Now that I have the start I can run with it.
I think I'm may be on my way. Thanks guys. -----Original Message----- From: John Graham-Cumming [mailto:[EMAIL PROTECTED] On Behalf Of John Graham-Cumming Sent: Thursday, March 16, 2006 8:55 AM To: PATTON, BILLY (SBCSI) Cc: [email protected] Subject: Re: looking for help with auto creating rules with eval hierarchically PATTON, BILLY (SBCSI) wrote: > As the best of my understanding of what you sent, ${BB_${proj}}, the > following should work. > PROJECTS := lde ldg ldm ldf ldw lbf ldb > BB_lde := a > BB_ldg := b c > BB_ldm := d e f > BB_ldf := g h i j > BB_ldw := k l n m o > BB_lbf := p q r s t u > BB_ldb := v w x y z aa ab > > .PHONY : all $(addprefix BB_ , ${PROJECTS}) This line will expand to .PHONY: all BB_ lde BB_ ldg BB_ ldm BB_ ldf BB_ ldw BB_ lbf BB_ ldb Firstly there's a space after BB_ which I don't think you want and secondly I'm not sure that you mean that BB_lde (for example) is a target; isn't it that the things in $(BB_lde) are you targets? > define bb_template > $(1): ; echo $(1) > endef > > all : $(addprefix BB_ , ${PROJECTS}) So this line is: all : BB_ lde BB_ ldg BB_ ldm BB_ ldf BB_ ldw BB_ lbf BB_ ldb Even if you eliminate the space after the _ and get all : BB_lde BB_ldg BB_ldm BB_ldf BB_ldw BB_lbf BB_ldb Is that really what you want? > $(foreach proj,$(PROJECTS), $(eval $(call bb_template,$(BB_$(proj))))) This ends up calling bb_template on each of $(BB_lde), $(BB_ldg), ... etc. If you take, for example, $(BB_ldg) that's b c. So it does $(call bb_template,b c) which is b c: ; @echo b c Which is then $(eval)ed which means that GNU Make ends up defining the following two rules: b: ; @echo b c c: ; @echo b c Once again I don't think that's what you intended. This came about because of the elimination of my second foreach loop. > But it doesn't. I get missing seperator pointing to the line after all: Probably because you've got a blank link between the all: line and the $(foreach ...) line. 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
