Recently Written · git

tmpl

Insanely simple templates

git clone https://github.com/equwal/tmpl

Log | Files | Refs


make/functions/foreach-complex (415 bytes)

1 # foreach: expand text once per list item
2 #foreach VAR,LIST,TEXT
3 # VAR and LIST are expanded
4 # VAR is set to each item in LIST and TEXT is expanded repeatedly
5 # so text is expanded $(words LIST) times
6 # you probably will use VAR each time...
7 # example:
8 # words = I love jesus dick
9 # foreach word,$(words),$(shell echo $(word))
10 var = <++> # i or something
11 list = <++>
12 text = <++>
13 $(foreach $(var), $(list), $(text))