[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: How to take union or intersection of two variables?

**From**: |
Peng Yu |

**Subject**: |
Re: How to take union or intersection of two variables? |

**Date**: |
Thu, 31 Dec 2009 11:11:58 -0600 |

On Thu, Dec 31, 2009 at 10:51 AM, David Boyce <address@hidden> wrote:
>* On Thu, Dec 31, 2009 at 10:14 AM, Peng Yu <address@hidden> wrote:*
>*> On Wed, Dec 30, 2009 at 5:50 PM, Sam Ravnborg <address@hidden> wrote:*
>*>> union = $(sort $(A) $(B))*
>*>> intersection = $(filter $(A), $(B))*
>*>>*
>*>> I did not test this but I think this works.*
>*>*
>*> 'union' works, but 'intersection' should be*
>*>*
>*> intersection= $(filter $(A), $(B))*
>
>* Umm ... assuming there are no non-printing characters in use, this is*
>* absolutely identical to what Sam posted.*
There are no non-printing characters in A and B. According to the
following example, ',' is required in filter, right?
$ make
Makefile:8: *** insufficient number of arguments (1) to function
`filter'. Stop.
$ cat Makefile
.PHONY: all
A= a a b b c
B= b c d
union= $(sort $(A) $(B))
#intersection= $(filter $(A), $(B))
intersection= $(filter $(A) $(B))
intersection:
echo $(intersection)
union:
echo $(union)