help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: looking for help with auto creating rules with eval hierarchically


From: John Graham-Cumming
Subject: Re: looking for help with auto creating rules with eval hierarchically
Date: Thu, 16 Mar 2006 15:29:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

PATTON, BILLY (SBCSI) wrote:
__BEGIN__
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 \
         ${PROJECTS} \
         $(addprefix BB_ , ${PROJECTS})

define proj_template
 $(1): $(addprefix BB_ , ${PROJECTS})
        @echo $(1)
endef
define bb_template
 $(1):
        @echo $(1)
endef

all : ${PROJECTS}

$(foreach var,$(PROJECTS),$(eval $(call proj_template,$(var))))

$(filter-out ldb,${PROJECTS}) : ldb

$(foreac proj,$(PROJECTS),$(foreach bb,$(BB_$(proj)), $(eval $(call
bb_template,$(bb)))))

#$(foreach proj \
#   , ${PROJECTS} \
#   , $(foreach bb \
#       , $(addprefix BB_ , ${PROJECTS}) \
#       , $(eval $(call bb_template, ${bb})) \
#      ) \
# )

__END__

1. You copy and pasted my code from a previous mail which contained a typo: foreac should be foreach

2. You've still got lots of $(addprefix BB_,...) in your Makefile and that's not doing what you think and needs to be changed as I described before.

John.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]