[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: variable parameter list
From: |
Warlich, Christof |
Subject: |
RE: variable parameter list |
Date: |
Fri, 12 Nov 2010 16:03:31 +0100 |
> Don't know if that's what you want but the simplest solution would be to
> treat list of files a third parameter instead as separate arguments i.e.
>
> define FILTER_RULE
> ${2}: ${3}
> cat $$^ | ${1} >$$@
> endef
>
> all: sorted.tgt header.tgt reverse.tgt footer.tgt
>
> $(eval $(call FILTER_RULE, sort, sorted.tgt, list1.lst list2.lst))
> $(eval $(call FILTER_RULE, head -n1, header.tgt, list1.lst list2.lst
> list3.lst))
> $(eval $(call FILTER_RULE, tac, reverse.tgt, list1.lst))
> $(eval $(call FILTER_RULE, tail -n1, footer.tgt, list1.lst list2.lst
> list3.lst list4.lst list5.lst list6.lst list7.lst list8.lst))
>
> Note no commas between list*.lst files.
>
> Krzysztof
Oh, yes, amazingly simple, and it just fits my needs. Thanks a lot for
your suggestion! It seems that I'm still thinking in terms of the shell,
where spaces are parameter delimiters.