help-make
[Top][All Lists]
Advanced

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

usage of eval


From: hans . peter . van . lohuizen
Subject: usage of eval
Date: Mon, 24 Nov 2003 12:36:10 +0100


Hi,

Currently I have the following rule setup (adding wildcard rules to other excisting rules) imported via include which works just fine (thanks to Paul Smith!):

 MODULES = Mod1 Mod2.....

 MOD_PATH = $(foreach OBJ,$(MODULES),../../$(OBJ)/synopsys)

 .generated.mk : makefile
        @rm -rf $@
        @for t in $(MOD_PATH); do \
                print "$$t/ddb/generic.db : \\"                                   >>$@;\
                print "       \$$(wildcard $$t/cmd/*specific.tcl) \\"  >>$@;\
        done

 include .generated.mk

 %ddb/generic.db : %cmd/dc_setup.tcl \
                                      %cmd/generic.tcl
        commands.....

--------
But it is preferred not to have any external files.
So I tried to achieve the same with "eval" but somehow the extra rule is not included now.
Below my trial, could someone tell me what the correct syntax should look like?


 define ADD_rules
       $(1)/ddb/generic.db : $(1)/$(wildcard /cmd/*specific.tcl )
 endef

 $(foreach mod,$(MOD_PATH),$(eval $(call ADD_rules,$(mod)) ) )

%ddb/generic.db : %cmd/dc_setup.tcl \
                                      %cmd/generic.tcl
        commands.....



Thanks a lot!!


Hans Peter.

reply via email to

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