tech-toolchain archive

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

(b)make: selecting every other element from a list

Sorry, just posted to the wrong list.

Is there a sane way of, in a Makefile, selecting every other (i.e. either 
even or odd, I don't care) member from a list?
I'm aware of bmake's nice feature of iterating on tuples, but I need to 
select a unique subset of those list members. I.e., given
	l= foo 1 bar 2 foo 3
	l= 1 foo 2 bar 3 foo
if that's more convenient, I want foo bar (or bar foo), so I'd need 
something like ${l:[!odd!]:O:u}

Home | Main Index | Thread Index | Old Index