Please check my makefile:

================
define show
    echo "[$1]"
endef

filelist = 1.c 2.c 3.c

all:
    @$(call show,1.c)
    @$(call show,2.c)
    @$(call show,3.c)

# That code below cannot work!
#all2:
#    @$(foreach f,$(filelist),$(call show,$p))
================

I'd like to dynamically generate N shell commands under "all" targets when
filelist has N words. How can I do it? Without the ultimate solution,
everytime I add a word to filelist, I have to manually add one command line
under "all". Quite boring, right?

Thank you in advance.
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to